Examples 1 9 when you want to refer to one of

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 3456789 [:alnum:] All alphabetic and numeric [:lower:] Lower case alphabetic [:upper:] Upper case alphabetic [:punct:] Punctuation characters [:blank:] Blank characters, i.e. space or tab These can be used in conjunc+on with other characters, for example [[:digit:]_]! Return to rep1!c@ted •  What will this match? [[:alpha:]][[:digit:][:punct:]][[:alpha:]] •  Can you foresee any problems with it? Func+ons that use Regular Expressions •  grep(pattern, x) It looks for the regular expression in pattern in the character string(s) in x. It returns the indices of the elements for which there was a match. •  gsub(pattern, replacement, x) Look the regular expression in pattern in x and replace the matching characters with replacement (all occurrences) sub() works the same way but only replaces the first occurrence. Func+ons that use Regular Expressions •  regexpr(pattern, text) returns an integer vector giving the star+ng posi+on of the first match or - 1 if there...
View Full Document

This document was uploaded on 02/16/2014 for the course STATISTICS 3026 at Columbia.

Ask a homework question - tutors are online