Solved

Pattern Matching LF in Dreamwever CS5

Posted on 2014-02-20
2
286 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Pixelmator App - Force Quit - NO! 2 59
Downgrading from Python 3.4.5 to 3.4.3 5 38
mac teminal 3 22
MS Remote Desktop 8 for MAC 6 15
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…
In this article we have discussed about the OS X EI Capitan and how to fix Wi-Fi issue in OS X El Capitan. We have explained how to delete system level preferences and create a new Wi-Fi location to resolve Wi-Fi issue.
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 …

775 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