Gilles wrote:
Hi,
I try do to a simple thing :
Knowing If a string like 13 exist in a string like 123
Or if 37 exist in 12356789
I tried many solutions, but never found one good so I try to do it with
loops which more difficult but not impossible
I'd like to know if with RegExp it's more
Gilles wrote:
Hi,
I try do to a simple thing :
Knowing If a string like 13 exist in a string like 123
Or if 37 exist in 12356789
I tried many solutions, but never found one good so I try to do it with
loops which more difficult but not impossible
I'd like to know if with RegExp it's more
Hi,
I try do to a simple thing :
Knowing If a string like 13 exist in a string like 123
Or if 37 exist in 12356789
I tried many solutions, but never found one good so I try to do it with
loops which more difficult but not impossible
I'd like to know if with RegExp it's more simply
Thanks
On Nov 10, Gilles said:
I try do to a simple thing :
Knowing If a string like 13 exist in a string like 123
Or if 37 exist in 12356789
You're not looking for '13', you're looking for '1..3'. The simplest
way to do this is:
if (123 =~ /1.*3/) {
print found 1...3\n;
}
--
(@testNumbers){
if($_ =~ /1/ and $_ =~ /3/){
print $_ has a 1 and a 3\n;
}
}
#
-Original Message-
From: Gilles [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 09, 2005 5:50 PM
To: 'beginners perl'
Subject: RE: Is it possible with RegEx
No,
I