Regular expressions: Difference between revisions

m
→‎{{header|Python}}: PEP-8 whitespace, Python 3 compatibility
(Updated D entry)
m (→‎{{header|Python}}: PEP-8 whitespace, Python 3 compatibility)
Line 1,409:
string = "This is a string"
 
if re.search('string$', string):
print("Ends with string.")
 
string = re.sub(" a ", " another ", string)
print (string)</lang>
 
=={{header|R}}==
Anonymous user