Hi there,
what is the best way to remove all chars but:[text]1-9a-Z|-_.,#%(){}[]~^+?![/text]
If regex is the way to go, could anyone please give me the regex sentence I should use?
Thanks!
Merry xmas!
Remove chars
Moderator: General Moderators
Re: Remove chars
Try this one:
Code: Select all
$charset = '1-9a-zA-Z\|\-\_\.\,\#\%\(\)\{\}\[\]\~\^\+\?\!';
$string = '@12345678900-=+_aAbBcC';
$result = preg_replace('/[^'.$charset.']/i', '', $string);Re: Remove chars
You don't need regular expressions, but it will work.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.