Skip to content
Prev 277301 / 398506 Next

Help with text separation

Hi

r-help-bounces at r-project.org napsal dne 14.11.2011 14:54:05:
only
string.
Hm. I am not at all an expert in regular expressions but recently I 
learned some ways (thanks Uwe)

sub("^(~)\\+(.+)\\+$", "\\1\\2", gsub("[[:alnum:]]+\\*[[:alnum:]]+", "", 
form))
[1] "~Intro+Intro/Intro1++benefit+benefit/benefit1+product+action+mean"

this will remove all values xxxxxx*yyyyy from your form together with 
leading and trailing +

I wonder if any automatic process can remove only one from several 
xxxxxx*yyyyy substrings.

Regards
Petr

PS and still it is not perfect as there is one middle + more.
<sarah.goslee at gmail.com>wrote:
not
M')
and to
also
'+L*M'
going
M')
consider a
them in
does,
for the
2Fwww.upstreamsystems.com%2F&sa=D&sntz=1&usg=AFrqEzfKYfaAalqvahwrpywpJDL9DxUmWw>
http://www.R-project.org/posting-guide.html