re

Pragma that lets you alter the behavior of regular expressions. Permits the following alterations:

use re 'debug'

Causes Perl to produce debugging messages when compiling and at runtime when using regular expressions. See the re manpage and the section on “Debugging regular expressions” in the perldebug manpage for details.

use re 'eval'

Permits a regular expression to contain (?{...}) zero-width assertion even if the regular expression contains variable interpolation, which normally isn’t permitted for security reasons. The pragma is ignored if the regular expression comes from tainted data.

use re 'taint'

When a tainted string is the target of a regular expression, causes the regular expression memories (or the values returned by the m// operator in list context) to be tainted.

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.