Perl RegEx conversion to 'Basic' -


i'm using grep in freebsd appears freebsd not support perl regex. i'm wondering version following have work in freebsd using 'basic' expression:

grep -po "(?<=addr.)[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*" 

why not use perl - installed default.

perl -ne 'print $1 if m/(?<=addr.)([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)/' 

of course @ point don't need behind more either.

perl -ne 'print join ("\n", m/addr.(\d+\.\d+\.\d+\.\d+)/)' 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -