Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Match domain names except one

by vinoth.ree (Prior)
on Feb 13, 2013 at 08:02 UTC ( #1018496=note: print w/ replies, xml ) Need Help??


in reply to Match domain names except one

should not match with the string (wt)

If you do not want to match wt string directly check for unless /\.wt\./ and print.

use strict; use warnings; use utf8; while(<DATA>) { unless(/\.wt\./) { print "matches : $_\n"; } } __DATA__ https://www.abc.com.wi.pr.com/ https://www.abc.com/ https://www.def.com.wi.pr.com/ https://www.wt.com.wi.pr.com/


Comment on Re: Match domain names except one
Select or Download Code
Re^2: Match domain names except one
by Anonymous Monk on Feb 13, 2013 at 08:16 UTC
    Thanks. But we need it in a regex

      Thanks. But we need it in a regex

      Maybe you can write a regex

      What strange business requirement indicates that you "need it in a regex"?

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.

      Well then, I have some excellent news for you: /\.wt\./ is a regex.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018496]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2015-07-07 01:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (86 votes), past polls