let\'s say i hve a string S = \"1 this is a number=200; Val+54 4class find57\"
S = \"1 this is a number=200; Val+54 4class find57\"
i want to use Regex to extract only this numbers:
Regex
Just use word boundaries. \b matches between a word character and a non-word character.
\b
\b\d+\b
OR
\b[0-9]+\b
DEMO
Escape the backslash one more time if necessary like \\b\\d+\\b or \\b[0-9]+\\b
\\b\\d+\\b
\\b[0-9]+\\b