Re: [R] matching problem

From: Tom.O <tom.olsson_at_dnbnor.com>
Date: Fri, 27 Jun 2008 07:11:23 -0700 (PDT)

Thanks guys, all of you. You have just made this weekend a much more happier weekend.

Regards Tom

Hans-Jörg Bibiko wrote:
>
>
> On 27 Jun 2008, at 13:56, Tom.O wrote:
>

>>
>> Well I have tried that and it's unfortuanally not the solution.
>> This return all the characters in the string, but I dont want the  
>> characters
>> after the ending non-character symbol. Only the starting characters  
>> ore of
>> interest.
>>
>>> gsub("\\W*","", myexstrings,perl=T)
>> [1] "AAAAA" "BBBBB" "CCC"   "ddd"
>>

>
>
> Oops,
>
> try this one:
>
> gsub("^\\W*(\\w+)\\W.*","\\1", myexstrings,perl=T)
>
> --Hans
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
-- 
View this message in context: http://www.nabble.com/matching-problem-tp18152158p18156086.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 27 Jun 2008 - 15:06:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 27 Jun 2008 - 15:31:49 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive