January 11th, 2013, 10:21 AM
Join Date: Jan 2013
Time spent in forums: 1 h 9 m 40 sec
Reputation Power: 0
Regex matching characters unless they're at the end of a string
Not sure how to explain this, but here it goes.
could contain a string followed by none, one or multiple dots:
Using regex I'm looking for any invalid characters in $val and then I want to replace them.
$inv is an array of invalid entries, this also includes a dot.
How do I strip all $inv characters from $val EXCEPT any dots on the end? eg:
if $val = te%st...
the correct result should be testů
if $val = te.est.
the correct result should be test.
Hope that makes sense. Thanks.