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

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -