I had to split a string into his numbers.
For example the string looks like that:
VAR_1123 Var_G -12.34 VAR-14.34 12.4 12 -234
The result i’d like:
-12.34,
12.4
12
-234
I try this Regular Expression:
([\-]?[0-9]+[\.[0-9]+]?)
But the result includes also 1123 and -14.34.
How can i exclude all numbers that have an underscore or a character bevor?
For testing i use this link:
http://derekslager.com/blog/posts/2007/09/a-better-dotnet-regular-expression-tester.ashx
?:to mean a non-capturing match.[\-]to simply-.So the final regular expression looks like this:
See it working online: ideone