Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Regx: match without regarding space and case

by Sidhekin (Priest)
on Sep 13, 2007 at 06:06 UTC ( #638737=note: print w/replies, xml ) Need Help??


in reply to Regx: match without regarding space and case

This works for me:

my $x="My name is VC"; my $y="myname"; my $r = do { local $" = ' *'; my @r = split //, $y; qr/@r/i }; if ($x =~ /($r)/) { printf "Matched from %d to %d: '%s'\n", $-[0], $+[0], $1; }

Prints:

Matched from 0 to 7: 'My name'

print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://638737]
help
Chatterbox?
[GotToBTru]: heh
[GotToBTru]: I
[GotToBTru]: ve been looking at a document we have been sending to a customer for years now
[MidLifeXis]: We don't, at least in this case ;-)
[GotToBTru]: and it includes a reference number that I didnt recognize
[GotToBTru]: I had to dig into the code to find out where it came from .. and it makes no sense
[GotToBTru]: so I emailed my contact asking if we could just stop sending it .. I'm afraid she is going to ask "what is that anyway?"

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2017-01-20 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (176 votes). Check out past polls.