Regex Match "words" That Contain Periods perl -


i going through tcpdump file (in .txt format) , trying pull out line contains use of "word" v.i.d.c.a.m. embedded between bunch of periods , includes periods screwing me up, here example:

e..)..@.@.8q...obr.f...$[......tp..p<........smbs......................................ntlmssp.........0.........`b.m..........l.l.<...v.i.d.c.a.m.....v.i.d.c.a.m.....v.i.d.c.a.m.....v.i.d.c.a.m.....v.i.d.c.a.m..............w.i.n.d.o.w.s. .5...1...w.i.n.d.o.w.s. .2.0.0.0. .l.a.n. .m.a.n.a.g.e.r..

how handle that?

you need escape periods:

if ($string =~ m{v\.i\.d\.c\.a\.m\.}) {     ... } 

or if string entirely quoted, use \q escapes metacharacters follow.

if ($string =~ m{\qv.i.d.c.a.m.}) 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -