Basic HTML version of Foils prepared Sept 20 97

Foil 37 Regular Expressions -- Patterns

From Tutorial on PERL Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


Simple single-character patterns include:
  • Single explicit character, e.g., a
  • Dot . matches ANY character except newline \n
Character class is a single-character pattern represented as a set [c1c2c3...cN] which matches any one of the listed characters
  • [ABCDE] matches A B C D or E
  • [0-9] is same as [0123456789]
  • [a-zA-Z] matches any lower or uppercase letter
Negated character class is represented by a caret ^ after left [ square bracket
  • [^0-9] matches any character which is NOT a digit



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Sep 21 1997