regex question
Jason Crowe
jcrowe at cmuonline.net
Mon Jul 7 17:07:57 CDT 2003
Gene Dascher wrote:
> I always escape all non-alphanum characters (i.e., < ). Also, your
> code won't place the found value in $content, it checks the
> value of $content to match the regex. You need to do something like
> this:
>
>
> if ($content ~= m/Current
> bid:n</font>n</td>n.+n<.+$([0-9.,]+)</) {
> $content = $1;
> }
>
> I just tested this and it works fine.
>
> Gene
>
>
It doesn't seem to work for me. For the most part it's the same as what
I had. Here is more of the script to show what I am starting with. The
currently variable is never getting set.
if($ARGV[0]) {
$content =
get("http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=$ARGV[0]");
$content =~ s/r//g;
if($content ~= m/Current
bid:n</font>n</td>n.+n<.+$([0-9.,]+)</) {
$currently = $1;
$currently =~ s/,//g;
}
Thanks,
Jason
More information about the Kclug
mailing list