Questions tagged [non-alphanumeric]
65 questions
-1
votes
3 answers
Most Pythonic was to strip all non-alphanumeric leading characters from string
For example
!@#123myname --> myname
!@#yourname!@#123 --> yourname!@#123
There are plenty of S.O. examples of "most pythonic ways of removing all alphanumeric characters" but if I want to remove only non-alphabet characters leading up to first…

Blythe Simmons
- 143
- 3
- 10
-1
votes
4 answers
Insert space after every non alpahumeric character
Am trying to insert space before and after every non alphanumeric character in the string, for example string like (good+bad)*nice which will be entered by user, I want to make it look like ( good + bad ) * nice. The reason i want to do this, is…

user2579351
- 27
- 8
-1
votes
2 answers
PHP check if string contains certain percentage of alphanumeric characters
I have a php string $comment sometimes the $comment box will contain some non alphanumeric characters, is there a way to find out what percentage of $comment is alphanumeric?
Thanks

John
- 6,417
- 9
- 27
- 32
-2
votes
1 answer
Java regex to find a specific substring without alpha numeric characters before or after it
Not too familiar with regex so could use some pointers in the right direction if possible.
I have some possible String values which can be something like the following:
"88976756 ABC 33ddf33a24"
"89999ABC 3hhhj33"
"7ffhh7AB C78788sd"
What I need is…

Predz
- 201
- 1
- 7
- 17
-3
votes
1 answer
Pig Latin- keep non-letters python
I am currently writing a pig Latin code and it requires all the non-letters to be ignored ie left in the same place of the word. For instance, Tom's would be om'sTay. So I deleted all non-alphabetic characters using:
word = re.sub('[^A-Za-z]',…

Williams Celina
- 5
- 4