By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

PHP Regular Expressions Tutorial

Brugbarts tutorial on regular expressions in PHP.

Edited: 2017-08-03 14:28

Regular expressions can be useful when validating user-input, matching and replacing content. While this tutorial is aimed towards PHP, some of the patterns used in examples, may also work with other languages.


  1. Block non-latin characters with PHP – How to block characters specific to languages that you do not understand anyway.


  1. About white space in web design – How to handle linebreaks, tabs, and spaces.