Perl Regular Expression Problem
We are having a problem with Perl's evaluation of regular expressions.
Here is a code snippet:
# This regular expression is looking for a word ending in s followed
# by something in parentheses
# If the while-block is entered, $1 should contain the word
It works as expected for me and it's build 811. At this point I would take
it onto Bugtraq. Something's not right with ur build
C:\WINDOWS\Desktopperl
$method = 'Modules(M6833x LA)';
$method =~ /(\S+)s\s*\(\s*(.+)\s*\)\s*$/;
$method = $1 . s;
print( POST METHOD [$method]\n );
POST METHOD
[EMAIL PROTECTED] wrote:
Perl Regular Expression Problem
We are having a problem with Perl's evaluation of regular expressions.
Here is a code snippet:
# This regular expression is looking for a word ending in s followed
# by something in parentheses
# If the while-block
On Fri, 26 Sep 2003, Xu, Qiang (XSSC SGP) wrote:
Ted S. wrote:
Beckett Richard-qswi266 graced perl with these words of wisdom:
That should have been s/.*\///
Don't you have to escape the period, too?
s/\.*\///
No, we shouldn't, because here . stands for any single character except
Ted S. wrote:
Beckett Richard-qswi266 graced perl with these words of wisdom:
That should have been s/.*\///
Don't you have to escape the period, too?
s/\.*\///
No, we shouldn't, because here . stands for any single character except a
new line.
thx,
Regards,
Xu Qiang
On approximately 9/25/2003 6:45 AM, came the following characters from
the keyboard of Xu, Qiang (XSSC SGP):
Hi, all:
I have a regular expression that I can't understand.
Suppose $filename is a file name that includes the full path. Say, it is
/u/scan/abc.jpg,
The regular expression is:
Strohmeier Ruediger wrote:
Hi Xu Qiang,
unlike e.g. awk, vi or the shell, perl support different delimiter
for regexes. When a slash is part of the regex or the substitution
pattern, they can either be escaped (i.e. \/) or other characters can
be used as delimiters.
Thus the regex is
Glenn Linderman wrote:
Any delimiter can be used (other posters were correct about that).
The delimiter used affects which delimiter character would need to be
escaped in the regular expression. Generally, if something other
than / is used as the delimiter character, it is chosen because it
-Original Message-
From: Electron One [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 12:12 PM
To: [EMAIL PROTECTED]
Cc: Electron One
Subject: Another Regular expression problem
Hello Everyone,
I have a perl file that has
12:12 PM
To: [EMAIL PROTECTED]
Cc: Electron One
Subject: Another Regular expression problem
Hello Everyone,
I have a perl file that has this,
PerlFile.pl###
#!/usr/bin/perl
while
, March 10, 2003 12:12 PM
To: [EMAIL PROTECTED]
Cc: Electron One
Subject: Another Regular expression problem
Hello Everyone,
I have a perl file that has this,
PerlFile.pl###
#!/usr/bin/perl
Electron One wrote, on Monday, March 10, 2003 13:12
: while(){
: chomp;
: if(/\s*\$[a-z]\w+\s*/i){
: #if(/\b\$[a-z]\w+\b/i){
: print Matched: $` -- $ -- $' :\n;
: }
: else{
:print No match:$_\n;
: }
: }
:
:
Can anybody tell me what is wrong with the
following line ?
$prmpt =
/(^.*[:]\/home\/oracle[:=]{1,2})/;
I'm trying to use the value of $prmpt in a call to
Net::Telnet but before I can use the variable $prmpt, perl is complaining about
the format of the pattern. Any help would be
Lee Cullip wrote, on Wednesday, November 20, 2002 06:50
: Can anybody tell me what is wrong with the following line ?
:
: $prmpt = /(^.*[:]\/home\/oracle[:=]{1,2})/;
:
: I'm trying to use the value of $prmpt in a call to Net::Telnet but before I can
: use the variable $prmpt, perl is
, November 20, 2002 12:35 PM
Subject: RE: Regular Expression Problem
Lee Cullip wrote, on Wednesday, November 20, 2002 06:50
: Can anybody tell me what is wrong with the following line ?
:
: $prmpt = /(^.*[:]\/home\/oracle[:=]{1,2})/;
:
: I'm trying to use the value of $prmpt in a call to Net
On 20/11/2002 13:06:29 Lee Cullip wrote:
Thanks for replying Joe,
maybe if you see a bit more code you can get an idea for what I'm trying
to
do :
use Net::Telnet;
use IO::File;
$prmpt =~ /^(.*:\/home\/oracle[:=]{1,2})/;
[snip]
I still get the following error message though :
bad match
16 matches
Mail list logo