Regular expressions: Difference between revisions

m
Line 166:
 
=={{header|AWK}}==
AWK supports regular expressions, which are typically markedenclosed upusing withslash slashessymbols inat the front and back, and the "~"tilde regular expression binding operator:
<lang awk>$ awk '{if($0~/[A-Z]/)print "uppercase detected"}'
abc
Line 187:
abCDefGH
ab(CD)ef(GH)</lang>
 
Regular expression negation can be achieved by combining the regular expression binding operator with a logical not operator, as follows:
 
if (text !~ /strawberry/) {
print "Match not found"
}
 
=={{header|BBC BASIC}}==