| An Introduction to Regular Expressions | The Basics | 22 of 50 : [PREV] [NEXT] |
Standard Meta CharactersBackreferences (continued)Outside regular expressions, such as in the replacement part of a substitution, this backreference special variable is used as if it were a scalar variable named as an integer (e.g., $1, $2, $3, $99). So, if you want to swap the first two words of a string, for example, you could use:
More on the substitution operator later. |
| © 2003 Barbie barbie@missbarbell.co.uk | Home | http://birmingham.pm.org/ |