Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I want a regex that can match this:
# Need To match: # Hello One World # Hello World # HelloWorld # Hello One Two World # Hello Two Three World # Hello One Three World #Regex I Tried sub Filter { my $Text = shift; if ($Text=~m/Hello(one|two|three| )*World/g) { return 1; }else{ return 0; } }
Any help ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex Problem
by jwkrahn (Abbot) on Apr 11, 2010 at 16:15 UTC | |
|
Re: Regex Problem
by ww (Archbishop) on Apr 11, 2010 at 15:58 UTC | |
|
Re: Regex Problem
by Gangabass (Vicar) on Apr 11, 2010 at 15:55 UTC | |
|
Re: Regex Problem
by choroba (Cardinal) on Apr 11, 2010 at 21:34 UTC | |
|
Re: Regex Problem
by JavaFan (Canon) on Apr 12, 2010 at 09:23 UTC |