Articles about pcre | UserComp.com

Capturing only the first "image data" from file output: anchoring lazy grep patterns (and why MIME types are the better tool)

A greedy .*: prefix drags grep's lazy match to the second "image data" in file output. Anchor with \A and one lazy quantifier, or switch to file --mime-type for stable, scriptable results.

Read More