[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] - Regep question



Chris Brinegar wrote:
[snip]
> (snip)
> 
> while (<>) {
>   if (/\Q<\/font><\/font><\/form>\E/) {
>     $puts = 1;
>   }
>   elsif (/(?s)\Q<br>\E\n\n\Q<br>\E\n/) {
>    $puts = 0;
>   }
> 
> (end snip)
> 
> The first if statement seems to be working fine... but the next line is
> giving
> me the trouble...
> 
> what I'm searching for is
> 
> "<br>(newline)(newline)<br>(newline)"
> 
> somebody smack me in the head and tell me what I'm doing wrong...
> 
> thanks a bunch in advance...
[snip]

Are you in multi-line mode????
A multi-line regular expression like you have written here will not work
unless you specify mulit-line mode either via the $* variable or by
using the /m modifier( add the 'm' to the end of the search e.g.
/(pattern)/m

Also I am unsure what the (?s) does.  What are you trying to accomplish
here ???  Do you really want (\s?) (meaning match 0 or 1 whitespace
character)???

		Hope this helps,
					Gary
-- 
Gary Ebert                                 Operations Administrator
Voice:     (301) 428-2115                  Mobile Datacom Corporation
Fax:       (301) 428-1004                  19540 Amaranth Drive
Pager:     (800) 490-7478                  Germantown, MD  20875-2126

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch