Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

replace string between two regex python

a = r''' Example
This is a very annoying string
that takes up multiple lines
and h@s a// kind{s} of stupid symbols in it
ok String'''

import re
re.sub('
This.*?ok','',a, flags=re.DOTALL)
' Example String'
 
PREVIOUS NEXT
Tagged: #replace #string #regex #python
ADD COMMENT
Topic
Name
8+2 =