- Forums
- PHP
- Regular Expression Metacharacters Table
i post this table here because it has helped me with php programming regular expressions so maybe it will help you too [2102], Last Updated: Mon Jun 24, 2024
Luimigle
Sun Sep 05, 2010
0 Comments
456 Visits
i post this table here because it has helped me with php programming regular expressions so maybe it will help you too
Regular Expression |
Will match... |
foo |
The string "foo" |
^foo |
"foo" at the start of a string |
foo$ |
"foo" at the end of a string |
^foo$ |
"foo" when it is alone on a string |
[abc] |
a, b, or c |
[a-z] |
Any lowercase letter |
[^A-Z] |
Any character that is not a uppercase letter |
(gif|jpg) |
Matches either "gif" or "jpeg" |
[a-z]+ |
One or more lowercase letters |
[0-9\.\-] |
Ðny number, dot, or minus sign |
^[a-zA-Z0-9_]{1,}$ |
Any word of at least one letter, number or _ |
([wx])([yz]) |
wy, wz, xy, or xz |
[^A-Za-z0-9] |
Any symbol (not a number or a letter) |
([A-Z]{3}|[0-9]{4}) |
Matches three letters or four numbers |