How to capture float and decimal numbers after equal sign REGEX -
i'm try float or decimal numbers grep -p
example= jrockit.gc.latest.yc.number = 5034;
i want 5034.
here regex => (?:\s*=\s*)([0-9.]+) equal sign.
how number?
use \k keeps text matched far out of overall regex match.
grep -op '\s*=\s*\k[0-9.]+' file or
grep -op '\s*=\s*\k\d+(?:\.\d+)?' file
Comments
Post a Comment