$x = 'Andrew';
print 'match' if $x =~ /rew/;
match
print 'match' if $x =~ /And/;
match
# no match as and doesn't match And
print 'false' if $x =~ /and/;
print 'true' if $x =~ /and/i; # the 'i' is ignore case
match
Regex : Some simple examples
Some simple examples to start
Labels:
perl regex regular expressions
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment