13,420
edits
Changes
→Complex Regular Expressions
===Complex Regular Expressions===
<table align="right"><tr valign="top"><td>[[Image:re-4.png|thumb|right|175px|Example of using anchors.]]</td><td>[[Image:re-2.png|thumb|right|200px|Example of matching characters.]]</td><td>[[Image:re-1.png|thumb|right|200px250px|Example of using character class.]]</td><td>[[Image:re-2.png|thumb|right|200px|Example of matching zero or more occurrence.]]</td></table>The problem with using literals or simple regular expressions is that general patterns are matched.
For example, the pattern “'''the'''” would be matched for larger word containing that pattern like '''there''', '''they''', '''either''', '''them''', '''their''', etc. Another problem is that you may want to search for pattern at a specific location within the string of text (like at the beginning or end).