How can I remove only letters from string ?
For example, I have this text 345-d34 XX
And I want to get 345-34
I tried this code:
If you really only want to remove (latin) letters from your string:
If you want to keep only digits and hyphens:
NB: If you plan to use the second solution and want to add other characters you want to keep, make sure to keep the hyphen last in the class, otherwise it changes meaning and will act like a range.