Solved

Pattern Matching LF in Dreamwever CS5

Posted on 2014-02-20
2
278 Views
Last Modified: 2014-02-20
I need to remove some <b> tags around href tags.  I have some href lines that span more than one line so my pattern isn't matching when it hits the LF character.

<p><b>  <a href="http://www.thefrugallife.com/auto_lease.html">Getting Out of an Auto *** this is where the LF is **************
  Lease</a></b></p>

Open in new window


Here is my code the regex flavor is Javascript (MSIE standard)

<b>([\s|\r\n]+)?<a href="(.+)?.html">(.+)?</a>([\s|\r\n]+)?</b>

Open in new window


Please help me figure this out.

Thanks,

Randal
0
Comment
Question by:sharingsunshine
2 Comments
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 39875559
At the very end of the regex you have:

</a>([\s|\r\n]+)?</b>

Open in new window


Match the closing </a>, followed by one or more whitespaces or linebreaks one time followed by the closing </b> tag.

The source code has:

this is where the LF is **************
  Lease</a>

Open in new window


The line break occurs before the </a>, not after. So no match.

<b>([\s|\r\n]+)?<a href="(.+)?.html">(.+)?([\s|\r\n]+)?(.+)</a></b>

Open in new window


Should work.
0
 

Author Closing Comment

by:sharingsunshine
ID: 39875721
Absolutely correct, I can't believe I didn't see that, but I am glad you did.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In certain circumstances, a Microsoft Office mac application may fail to save a document to a network server, with the following error message: "There has been a network or file permission error. The network connection may be lost." An article at…
Deploystudio is a system which can be used to deploy OSX clients and servers within the small/medium or large business environments. The system is built onto of the OSX Server NetBoot system and uses images & workflows as its core assets. While work…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now