help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: regexp with match over multiple lines


From: AngusC
Subject: Re: regexp with match over multiple lines
Date: Fri, 6 May 2011 04:10:30 -0700 (PDT)


Peter Dyballa wrote:
> 
> 
> Am 05.05.2011 um 20:15 schrieb AngusC:
> 
>>       ]]>^M
>>    </description>
>>
>> and I am using:
>> <\1\[CDATA.*^J*>
> 
> 
> If you see ^M then you should switch to some DOS or MAC encoding. But  
> what's puzzling me is that not all lines have ^M at the end. Does this  
> work: "<!\[CDATA\[[^>]+>"? I think other expressions would become too  
> greedy...
> 
> BTW, is this \1 what you are really using or is it a typo, actually  
> meaning "!"? (Which isn't special in Lisp, I think.)
> 

Interestingly I made a mistake in missing out the first " character and it
worked.

This is what works:
<!\[CDATA\[[^>]+>"?

But not "<!\[CDATA\[[^>]+>"?

Anyway, I don't understand what the " bit in there is doing (nor some of the
other stuff) so I will study further.  Thanks a lot.


Yes the \1 was a type - meant to be \!

The file was created from a perl script - so yes ^M is not something I
usually see in other files.

Angus

-- 
View this message in context: 
http://old.nabble.com/regexp-with-match-over-multiple-lines-tp31548643p31557911.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]