Appendix B. Regular Expressions

ModSecurity rules rely heavily on regular expressions to allow you to specify when a rule should or shouldn't match. This appendix teaches you the basics of regular expressions so that you can better make use of them when writing ModSecurity rules. Regular expressions are also useful in a number of other areas, including programming, text processing, and Linux administration, so learning about them is definitely worth the investment in time.

What is a regular expression?

A regular expression (often abbreviated as regex or regexp) is a way to identify strings of interest. Regular expressions can be used to search through large amounts of text to find specific strings, or to make sure a particular string matches a ...

Get ModSecurity 2.5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.