I want a regular expression that matches based on this rule: searching for the first number in a string and checking if it's alone in its neighborhood (the character before and after the number is SPACE, or the character before is SPACE and it's the ending part of the string).
A few examples below:
ABC AB34.1 ABC 39.25 AB:39.25ABC AB34.1 ABC 39.25:39.25ABC 34.1AB ABC 39.25:39.25
I know that /^[^\d]*(\d+)/ can match the first number in the string, but I don't know how to check if it contains SPACES before and after itself, or SPACE before and maybe \n after.
Thanks in advance.