in reply to Re^2: pattern matching for string [SYN, ACK]
in thread pattern matching for string [SYN, ACK]
I'm still not clear on what you want.
Maybe you want:
$user_string = "[SYN, ACK]"; if ($x =~ /\Q$user_string\E/) { print("match\n"); } else { print("no match\n"); }
Maybe you want:
$user_string = "[SYN, ACK]"; if ($x =~ /(\[.*?\])/) { if ($1 eq $user_string) { print("match\n"); } else { print("no match\n"); } } else { print("not even close\n"); }
By the way, use [ for [ and ] for ] in your posts. Better yet, don't escape anything and place code and code bits within <c>...</c> tags.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: pattern matching for string [SYN, ACK]
by phemal (Sexton) on Sep 15, 2006 at 02:26 UTC |