“Python Expressão regular Remova números” Respostas de código

python regex remove dígitos da 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)
wolf-like_hunter

Python Expressão regular Remova números

value = '12 QZR 44A'
def remove_numbers(name):
    return re.sub(r'\w*\d\w*', '', name).strip()
value.apply(remove_numbers) 
Troubled Tiger

Expressão regular Remova os números da pitina de corda

#remove any number from a string
string = 'abc123'
remove_num = ''.join(i for i in string if not i.isdigit()
NotACoder

Respostas semelhantes a “Python Expressão regular Remova números”

Perguntas semelhantes a “Python Expressão regular Remova números”

Mais respostas relacionadas para “Python Expressão regular Remova números” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código