dhackbar has asked for the wisdom of the Perl Monks concerning the following question:
I've got a string with this text "(7001) - This is some text" and I want to see if it matches this pattern: "([7000|7001|7002]) - This".
Basically, I want to have something like this (which doesn't work).
my $full_text = "(7001) - This is some text"; my $check_str = "([7000|7001|7002|7003]) - This"; if ($full_text =~ /$check_str/) { print "full_text has the check_str\n"; }
Thanks! Derek
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regular Expression Help
by GrandFather (Saint) on Nov 15, 2005 at 23:55 UTC | |
by dhackbar (Initiate) on Nov 16, 2005 at 13:18 UTC | |
by Eimi Metamorphoumai (Deacon) on Nov 16, 2005 at 15:54 UTC | |
by GrandFather (Saint) on Nov 16, 2005 at 19:37 UTC | |
|
Re: Regular Expression Help
by Roy Johnson (Monsignor) on Nov 15, 2005 at 22:26 UTC | |
|
Re: Regular Expression Help
by monarch (Priest) on Nov 15, 2005 at 22:21 UTC | |
|
Re: Regular Expression Help
by injunjoel (Priest) on Nov 15, 2005 at 22:43 UTC |