Solved

Pattern Matching LF in Dreamwever CS5

Posted on 2014-02-20
2
317 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
We could spend the next millennium discussing the differences of the Mac and Windows platforms. The next century will continue to have fanatics on both side of the equation and neither side will win the war. However, that’s not why we are here. W…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

622 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