Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python regex remove digits from string

# credit to the Stack Overflow user in the source link
# add a space before d+ to exclude numbers close to letters, as b3 for example

s = "This must not be deleted, but the number at the end yes 134411"
s = re.sub("d+", "", s)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #regex #remove #digits #string
ADD COMMENT
Topic
Name
2+4 =