PHP Manual

  • English French German Portuguese Spanish
PHP Manual Function Reference Text Processing PCRE Examples
PCRE Introduction Installing/Configuring Predefined Constants Examples PCRE Patterns PCRE Functions
  • Predefined Constants
  • PCRE Patterns

Examples

Example #1 Examples of valid patterns

  • /<\/\w+>/
  • |(\d{3})-\d+|Sm
  • /^(?i)php[34]/
  • {^\s+(\s+)?$}

Example #2 Examples of invalid patterns

  • /href='(.*)' - missing ending delimiter
  • /\w+\s*\w+/J - unknown modifier 'J'
  • 1-\d3-\d3-\d4| - missing starting delimiter

© Copyright © 2001-2015 The PHP Group.

© Copyright 2014. Diseñado por PHP Manual usando jfCMS.