help Help

preg_match preg_match_all (Don't forget the delimiters for the pcre functions)

preg_match preg_match_all (Don't forget the delimiters for the pcre functions)

Display results ?
  • Highlight
  • array
  • Timing
Pattern#1: preg_match_all #\bthe(?:se)?\s(\w+)\b#i

How to find "the" and "these" followed by a word (to capture) in the following text:

The syntax for patterns used in these functions closely resembles Perl. The expression should be enclosed in the delimiters, a forward slash (/), for example. Any character can be used for delimiter as long as it's not alphanumeric or backslash (). If the delimiter character has to be used in the expression itself, it needs to be escaped by backslash. Since PHP 4.0.4, you can also use Perl-style (), {}, [], and <> matching delimiters. See Pattern Syntax for detailed explanation.

Pattern#2: preg_match_all #\b(?:(?i)the|these)\s(\w+)\b#

How to find "the" and "these" followed by a word (to capture) in the following text:

The syntax for patterns used in these functions closely resembles Perl. The expression should be enclosed in the delimiters, a forward slash (/), for example. Any character can be used for delimiter as long as it's not alphanumeric or backslash (). If the delimiter character has to be used in the expression itself, it needs to be escaped by backslash. Since PHP 4.0.4, you can also use Perl-style (), {}, [], and <> matching delimiters. See Pattern Syntax for detailed explanation.

Create a link to the results of this test.

Do you want to create a link to this result page? Create Link

Links

Tutorial and Simulator by Jean-Luc Lacroix (regains scs). Any suggestions and/or new ideas for improvement - or better translation - are welcome! Thanks to Nicolas Chambrier for his review and comments. Contact: address