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
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
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
3 matches
Mail list logo