Regular expressions: Difference between revisions

(Add Genie)
Line 756:
print "matched '%s' in '%s'", re.get_pattern(), sentence
 
print ("replace with 'anotherdifferent': %s", re.replace(sentence, sentence.length, 0, "another")
re.replace(sentence, sentence.length, 0, "different"))
 
except err:RegexError
Line 765 ⟶ 766:
prompt$ ./regularExpressions
matched 's[ai]mple' in 'This is a sample sentence.'
replace with 'anotherdifferent': This is a anotherdifferent sentence.</pre>
 
=={{header|Go}}==
Anonymous user