$html =~ (andrew)
# matches andrew
((andrew)|(john)|(peter))
# matches andrew OR john or peter
# the same, but with whhitespace
# m# - use # as the delimiter
# #x - allow whitespace
$html =~ m#
(
( andrew ) |
( peter ) |
( john )
)#x;
Regex : Groups
Use ( ) for groups.
Labels:
perl regex regular expressions
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment