delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/17/23:18:54

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Tue, 17 Aug 2004 23:18:47 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: V DOT MIRCEVSKI AT soton DOT ac DOT uk
cc: cygwin AT cygwin DOT com
Subject: Re: cygwin-perl: matching behaves weird
In-Reply-To: <1092793767.4122b5a7c3eef@webmail.soton.ac.uk>
Message-ID: <Pine.GSO.4.61.0408172313140.24184@slinky.cs.nyu.edu>
References: <1092793767 DOT 4122b5a7c3eef AT webmail DOT soton DOT ac DOT uk>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.39

On Wed, 18 Aug 2004, V.MIRCEVSKI wrote:

> Now, this may be old news for many of you, but I'm new to cygwin, so 
> please don't shoot. I'd be happy if someone would post me a link to the 
> solution.
> 
> I'm doing quite strightforward matching using regular expressions in 
> perl (as you can see below) and the code used to work just fine on the 
> ActiveState perl, but behaves very strange with cygwin Perl:
> 
> -------------
> unless ($page =~ /<a href="\#" onClick="window\.open\('(popBibTex.cfm\?.+?)',/s)
> -------------
> 
> It simply does not match. I tried playing around, cuting certain suspicios 
> parts, and here is what I found out:
> 
> -------------
> unless ($page =~ /on\Click="window\.open\('(popBibTex.cfm\?.+?)',/s)
> -------------
> 
> this does match. (notice the \ before C)
> 
> What's up? (::confused;)
> 
> I'm runing Win_XP_Pro/SP2, just installed Cygwin (and all 
> tools/packages/modules that were available through the web install 
> utility).

Please review

> Problem reports:       http://cygwin.com/problems.html

particularly the part about attaching the output of "cygcheck -svr".  You 
haven't said which version of perl you're running, or even if you're 
running the Cygwin perl as opposed to some other version, or what your 
input was, or what the whole script is.  FWIW, I can't reproduce this on 
WinXP Pro, Cygwin 1.5.10-3, perl 5.8.2-1 with the following snippet:

echo "<a href=\"#\" onClick=\"window.open('popBibTex.cfm?aaa&bbb&ccc',ddd,eee)\">kkk</a>" | \
perl -e 'undef $/;$page=<>;unless ($page =~ /<a href="\#" onClick="window\.open\('"'"'(popBibTex.cfm\?.+?)'"'"',/s){print "No match\n";}else{print "Match\n";}'

It prints "Match"...
	Igor
P.S. BTW, '\C' in Perl REs matches any 8-bit character...
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019