Jay Savage <[EMAIL PROTECTED]> wrote:    On 2/1/07, oryann9 wrote:
> oryann9 wrote: Hello Perl list,
>
[snip]
>
> I was able to figure it out. The solution was /s.
> my $regexp = qr/.*\x3a5101.*/s;
>
> However, when I put multiple port numbers in the regexp it does NOT work.
> I want to store them in memory for later use which is why I am using 
> 1,2,3,4...
> my $regexp = qr/(.*\x3a5101.*)(.*\x3a5051.*)(.*\x3a3191.*)(.*\x3a1026.*)/s;

Take another look at perlre and perlretut.

That says, roughly:

You haven't included an "or" method anywhere; in order for a string to
match your pattern, it has to contain all four complete elements.

Also, why '\x3a' instead of ':'? and finally, if you're looking
anywhere in the string, you don't need '.*' on both sides of the
expression.

You're probably looking for something like

/:5101|:5051|:3191|:1026/
# or to capture the port number:
/:(5101|5051|3191|1026)/

perlre has the details on '|'.

HTH,

**************************************************
  Jay, thanks for the reply.  I am aware of the bit | operator and I tried 
using that prior to posting this message, but was having issues then.  I will 
try again.

 
---------------------------------
Access over 1 million songs - Yahoo! Music Unlimited.

Reply via email to