Regular expressions: Difference between revisions

Content added Content deleted
(Add Brat example of regular expressions)
m (→‎{{header|Python}}: fix 1 line)
Line 1,403: Line 1,403:


if re.search('string$',string):
if re.search('string$',string):
print "Ends with string."
print("Ends with string.")


string = re.sub(" a "," another ",string)
string = re.sub(" a "," another ",string)