I have sections of text that may contain both dollar amounts, that may or may not be prepended with a dollar sign, and IP addresses. I need a regular expression that will identify the dollar amounts but not match portions of the IP addresses.
For example if the text is:
12.34 56.78.90.12 34.56
My starting attempt was:
([1-9]\d*\.\d{2})
This is what I want to match, but it matches parts of the IP addresses. I then tried:
[^\.]([1-9]\d*\.\d{2})[^\.]
But this was worse on almost all cases.
The regular expression needs to match "12.34" and "34.56", but not "56.78" or "90.12". Any help would be appreciated.