Regular Expressions: An Introduction
Published: January 12, 2004
User Rating: 8.9 (282 votes)
Syntax
So taking the example above, we would say the syntax of regular expression is
where
identifier The pattern is always enclosed in a identifier. The most common identifier is the slash (/).
pattern Then there is the pattern, which you want to find and replace.
modifier And then there is the modifier. Modifier is like an option for the pattern, which define extra properties of the pattern matching.
For e.g. using the case-insensitive match modifier (i)
Patterns
To read (understand) or write a regular expression pattern, you should ask the three simple question
- What characters to match ?
- How many characters to match ?
- And where to match ?
And therein lies the power and simplicity of the regular expression. Taking few examples
About
Amit Arora is web developer with expertise in developing eCommerce enabled websites for the businesses.
Monitored by Site24x7
Uptime