hi there, just spent 1 hour on some regex tutorials but couldnt find anything about this: how can i say "match everything EXCEPT [0-9]"? i have a mixed string with letters, numbers and some special chars and i only need all the numbers in it. sorry if this i a lame question, but all i found was "match this and this or maybe this only if its followed by that" but not such a basic thing... its for php preg_replace(), if this matters...
no, already tried this before at http://www.georgiecasey.com/tools/regular-expression-tester/tester.htm my string is teststring123.abc ... i grab my bike and go for the bookstore now
I think we need a little more info. $data = 'teststring123.abc'; preg_replace(/[0-9]/, '',$data); will make $data become 'teststring.abc' $data = 'teststring123.abc'; preg_replace(/[^0-9]/, '',$data); will make $data become '123'