Content deleted Content added
RevRagnarok (talk | contribs) m Reverted to revision 119536228 by RevRagnarok. using TW |
→Examples: Added spaces to some of the print statements in the code examples |
||
Line 98:
$string1 = "Hello World\n";
if ($string1 =~ m/el*o/) {
print "There is an 'e' followed by zero to many ";
print "'l' followed by 'o' (eo, elo, ello, elllo)\n";
}
Line 111:
$string1 = "Hello World\n";
if ($string1 =~ m/l{1,2}/) {
print "There exists a substring with at least 1 ";
print "and at most 2 l's in $string1\n";
}
Line 256:
$string1 = "Hello World\n";
if ($string1 =~ m/rld$/) {
print "$string1 is a line or string ";
print "that ends with 'rld'\n";
}
Line 269:
$string1 = "Hello\nWorld\n";
if ($string1 =~ m/\AH/) {
print "$string1 is a string ";
print "that starts with 'H'\n";
}
Line 282:
$string1 = "Hello\nWorld\n";
if ($string1 =~ m/d\n\Z/) {
print "$string1 is a string ";
print "that ends with 'd\\n'\n";
}
Line 295:
$string1 = "Hello World\n";
if ($string1 =~ m/[^abc]/) {
print "$string1 contains a character other than ";
print "a, b, and c\n";
}
|