Hi I don't feel very well with regular expressions. What I would like to achieve is to extract a numeric substring (only 0-9 digits) from the input string.
- The numeric string that is searched should be preceded only by a
semicolon (
;
), space ( ) or should be placed exactly at the begining of the input (not line). - The numeric string that is searched should be followed only by a semicolon (
;
), the end of line or the end of the input string.
Exemplary input:
;x; ;SrvId=3993;ad257c823; 435223;
Output:
435223
I tried: [ \A|;|[ ]]\d*[\r|;|\Z]
but it did not worked, it did not even compiled.