Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks. I have a regex question. I have some regex in a script and I'm trying to parse for a new string and having problems. The problem is that the new string has several "/" in it. An example is "/strt/codes/76453". Here's the code that I'm trying to use to watch the regex:
push @matches, $_ if /^.*?(?:\b|_)$parse1(?:\b|_).*?(?:\b|_)$parse2(? +:\b|_).*?$/m;
I tried \/\ in $parse1 file with no success. The other problem is that the #s at the end of the string are all different so they're hard to match. I currently has nothing in $parse2. Any guidance on how to parse for the sought after string would be greatly appreciated. Thanks in advance.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: regex question
by Athanasius (Archbishop) on Feb 28, 2017 at 06:34 UTC | |
Re: regex question
by choroba (Cardinal) on Feb 28, 2017 at 06:18 UTC | |
by Anonymous Monk on Feb 28, 2017 at 16:52 UTC | |
by haukex (Archbishop) on Mar 01, 2017 at 08:56 UTC | |
Re: regex question (updated)
by haukex (Archbishop) on Feb 28, 2017 at 08:20 UTC | |
Re: regex question
by Monk::Thomas (Friar) on Feb 28, 2017 at 09:34 UTC |