Bootstrap FreeKB - Perl (Scripting) - Regular expression delimiter
Perl (Scripting) - Regular expression delimiter

Updated:   |  Perl (Scripting) articles

By default, the forward slash character is used to separate fields in regular expressions in Perl.

if ($foo =~ /hello/) { print "foo contains hello"; }


Using the m character, you can use a different character to separate fields in a regular expression. In this example, m is used and # is set as the delimiter.

if ($foo =~ m#hello#) { print "foo contains hello"; }


Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee


Add a Comment

Please enter 47568f in the box below so that we can be sure you are a human.