cygwin-perl: matching behaves weird

Igor Pechtchanski pechtcha@cs.nyu.edu
Wed Aug 18 06:39:00 GMT 2004


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@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.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/



More information about the Cygwin mailing list