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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -