DEV Community

Discussion on: How Unix programmers at restaurants search menus for their favorite plate

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
kenbellows profile image
Ken Bellows • Edited

That's what this bit at the end is for:

$[0-9]\.

That bit of the regex will only match on a line that contains a dollar sign ($), a single digit ([0-9]), and a literal dot (\.). So "$2.99" will match, but "$12.99" won't, because there are two digits between the dollar sign and the dot.

Collapse
 
moopet profile image
Ben Sinclair

Try it.