An Introduction to Regular Expressions The Basics 11 of 50 : [PREV] [NEXT]

Standard Meta Characters

The Character Class (continued)

Example 1:

The following regular expression matches a string consisting of at least one character that is not a space (and no spaces):

/^[^ ]$/

In this example the first caret matches the beginning of the string, whereas the second one indicates that the character class matches any character but those inside it (a space in this case).

Example 2:

"ABC" equals "..." and "[ABC].[^012]" but not "[012].[^ABC]"

© 2003 Barbie barbie@missbarbell.co.uk Home http://birmingham.pm.org/