> -----Original Message-----
> From: John Pitchko [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 10, 2002 10:51 AM
> To: [EMAIL PROTECTED]
> Subject: Regex Not Matching Newline
> 
> 
> Hello,
> 
> I am using: 
> s/<a href="(.+?)">(.+?)<\/a>/<a 
> href="\/cgi-bin\/template\.cgi\?file=$1">$2<\/a>/igs;
> 
> to match HTML in a file that is formatted like:
> <li>System Backup/Restore - <a 
> href="/Generic/Netbackup/nbrestor.html">NetBackup 
>      Restore Document</a></li>
> <li>Sybase Backup/Restore - <a 
> href="/Generic/Netbackup/nbrestor.html">NetBackup Restore 
> Document</a></li>
> 
> The problem is that the pattern will match the second <li> 
> (which is all on one line) but will not match the first <li> 
> (which was broken up by Dreamweaver to 2 lines). I know that 
> in order for the . operator to match newlines, the /s 
> modifier needs to be used, which I do have, and this has 
> worked in the past but I am unsure why it is not working now.

Your regex successfully updates both links of the sample data when 
I run it. Are you sure the sample data you posted matches the data
giving you problems?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to