Perl 6 Perl 6 #25

Regular Expressions

Regular expression syntax is greatly improved

All punctuation is meta-syntactic (no lists to memorize)

Quotes can be used for literal matches

/ 'msg' \d+ '.txt' /         # "msg", digits, and ".txt"

Brackets now used for non-capturing groups:

/ [ alex | be+ | c+ ] /      # alex, be, bee, beee, ..., c, cc, ccc, ...
Copyright © 2008 Patrick Michaud