Web Design Tutorials and Articles: Regex SubPattern in PHP

By Chrysanthus - About Me - E-mail this page - Add to My Favorites - Add to Blog List - See other blogs in Computers & Internet

Wednesday, April 8, 2009

Regex SubPattern in PHP

PHP Regular Expressions – Part IV Introduction In this part of the series, I explain regex Grouping (subpattern) and Capturing in PHP. Groupings We can use parenthesis to group characters in a pattern. Consider the following pattern: /The (guitarist)/ “guitarist” is in parenthesis. The parentheses form a group or subpattern, which has the text: “guitarist”. Consider the following: /The (guitarist is good)/ “guitarist is good” is in parenthesis. The parentheses form a group, which has the text:... Sign in to see full entry.

Previous: More Regular Expression Patterns in PHP - New Entries - Next: Regex Modifiers in PHP

Headlines (What is this?)