Re: [R] help with regular expressions in R

2009-08-20 Thread Chuck Taylor
s. The regular expression "\\[.\\]" translates to "a [ followed by 0 or more instances of any character followd by ]". Best regards, Chuck Taylor TIBCO Spotfire Seattle -Original Message- I want to eliminate all characters that fall within square brackets as

Re: [R] regex question

2009-08-04 Thread Chuck Taylor
ring at the beginning of a word. R requires the extra backslash. "[[:alpha:]]" Any alphabetic character, upper or lower case gregexpr() returns a list; unlist() converts the list to a vector, each element of which points to the first character of a word in astr. That res

Re: [R] regexpr virtue

2009-07-29 Thread Chuck Taylor
quot;[0-9]") followed by the end of the line ("$"). The regexpr() function returns the position in the string x where that regular expression begins. Feed that to substring() and you get the desired result. Both substring() and regexpr() work on vectors of strings. Best regards, C