Hey guys,
at the moment im going to try to create a RegExp that matchs to integer values in strings.
So i don't have strings like this:
"
123
" or "
123.456
"
If that would be the case i could simply use "
^[\d]*$
" as RegExp.
But like i said, im going to try to get integer values in strings.
Two sample strings could look like this:
A sample integer value is for example 123456 Dollar<br />
Some other decimal value is for example 123.456 Dollar
The goal is, that the RegExp only get a matches the
123456
in the first string and not at
123
or
456
in the second one, because the second string contains a decimal value, not two integer values separated by a dot.
I hope i could make clear what i mean.
If not, feel free to ask.
Thank you so much for your help!
Edit:
I've played with RegExp and found the following two RegExp:
[\d]+(?!\.)
all numbers but no number bevore a dot
and
(?<!\.)[\d]+
all numbers but no number after a dot
But i'm confused how to connect them with a logical and operation to get only matches where is no dot bevore a number AND no dot after a number.