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

x
?
Solved

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

Posted on 2013-11-05
1
Medium Priority
?
367 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 64

Accepted Solution

by:
Fernando Soto earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
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…
Suggested Courses

963 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