Solved

ASP.NET/VB/REGEX:  Match variations of encoded br tag

Posted on 2013-11-05
1
357 Views
Last Modified: 2013-11-06
I want this to apply to all of these cases:

<br>
<BR>
<BR/>
<Br      />
<Br  />
</br>

input = RegularExpressions.Regex.Replace(input, "&lt;br/&gt;", "<br />")

Open in new window

0
Comment
Question by:hankknight
1 Comment
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 39625663
Hi hankknight;

Try this pattern, it should work for all the patterns given

input = RegularExpressions.Regex.Replace(input, "(?i)&lt;/?br\s*/?&gt;", "<br />")

Open in new window

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

708 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

19 Experts available now in Live!

Get 1:1 Help Now