Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

replacing a value in string using aregular expression pyhton

import re

s = 'aaa@xxx.com bbb@yyy.com ccc@zzz.com'

print(re.sub('[a-z]*@', 'ABC@', s))
# ABC@xxx.com ABC@yyy.com ABC@zzz.com
Source by note.nkmk.me #
 
PREVIOUS NEXT
Tagged: #replacing #string #aregular #expression #pyhton
ADD COMMENT
Topic
Name
7+6 =