Perl Best Practices: Regular Expressions: Always use /xms

Almost always at least.

DC explains quite well in the beginning of the section on Regular Expressions  [Link], why each of /x, /m, and /s is rather, rather reasonable to use.

  • /x : extended formatting / legibility
  • /m : let ^ and $ also match next to embedded n; “multiline mode”
  • /s : let . also match newline; “single …”

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.