RE: class regex



Brent Clark <mailto:bclark@xxxxxxxxxxxxxxxxxxxx> wrote:

: I have im trying to enhance my regex skill.
:
: My questions is, would
:
: m/^p11[016]/io
:
: match like
:
: m/^(p110|p111|p116)/io

Yes.


: Any tips or advice, would greatfully be appreciated.

Why not test you regex to see if it works? Asking
questions here will take much more time than testing.


foreach my $value ( @list_of_test_values ) {

print qq($value matches "m/^(p110|p111|p116)/io"\n)
if $value =~ m/^(p110|p111|p116)/io;

print qq($value matches "m/^p11[016]/io"\n)
if $value =~ m/^p11[016]/io;

}


HTH,

Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328





.



Relevant Pages