Is there a way regexreplace to get rid of all non-alphanumeric characters on a string? How?
If not, what's the alternative method?
Get rid of non-alphanumeric with RegexReplace
-
tiago
- Posts: 589
- Joined: 14 Feb 2011 21:41
Get rid of non-alphanumeric with RegexReplace
Power-hungry user!!!
-
highend
- Posts: 14955
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Get rid of non-alphanumeric with RegexReplace
Sure:
Code: Select all
$a="._ abc#123!%&"; $b=regexreplace($a, "([^a-zA-Z0-9]+)", ""); text $b;One of my scripts helped you out? Please donate via Paypal
-
tiago
- Posts: 589
- Joined: 14 Feb 2011 21:41
XYplorer Beta Club