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

php - Hide output during test execution -

javascript - Migrate custom AngularJS filter from 1.2.28 to 1.4.x -

Update Magento products with multiple images -