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' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -