Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Pattern Matching LF in Dreamwever CS5

Posted on 2014-02-20
2
Medium Priority
?
342 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 2000 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

Hire Technology Freelancers with Gigs

Work with 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

Whatever be the reason, if you are working on web development side,  you will need day-today validation codes like email validation, date validation , IP address validation, phone validation on any of the edit page or say at the time of registration…
We are witnesses that everyone is saying that our children shouldn't "play" with a technology because it is dangerous. This article is going to prove that they are wrong.
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…
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 …

783 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