Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Regex 101   (RSS)

MSDN Regular Expression Forum

There's now an MSDN Regular Expression Forum
Posted by ericgu | 1 Comments

Rule #1 of Regex debugging

Rule #1 of Regex debugging The regex engine isn't hung. It will finish eventually. However, "eventually" may not until after the heat death of the universe. You either didn't anchor your string, or you didn't think clearly about how the quantifiers "*"
Posted by ericgu | 2 Comments
Filed under:

Regex 101 posts - continue or not?

I've been getting bored with the regex 101 exercises that I 've been posting, as lots of them are simply variants of what I've posted in the past, and there's not really much value to add in the discussion. I have 9 more of the exercises remaining. Things
Posted by ericgu | 8 Comments

Regex 101 Answer I10 - Extract repeating hex blocks from a string

Regex 101 Exercise I10 - Extract repeating hex blocks from a string Given the string: PCORR:BLOCK=V5CCH,IA=H'22EF&H'2354&H'4BD4&H'4C4B&H'4D52&H'4DC9; Extract all the hex numbers in the form “H’xxxx” ***** You can match the hex digits
Posted by ericgu | 3 Comments

Regex 101 Exercise I10 - Extract repeating hex blocks from a string

Regex 101 Exercise I10 - Extract repeating hex blocks from a string Given the string: PCORR:BLOCK=V5CCH,IA=H'22EF&H'2354&H'4BD4&H'4C4B&H'4D52&H'4DC9; Extract all the hex numbers in the form “H’xxxx”
Posted by ericgu | 6 Comments

Regex 101 Discussion I9 - Count the number of matches.

Regex 101 Exercise I9 - Count the number of matches Given a string like: # # 4 6 # # 7 # 45 # 43 # 65 56 2 # 4345 # # 23 Count how many numbers there are in this string ----- There are a few ways to approach this problem. In all of them, we need a way
Posted by ericgu | 0 Comments

Regex 101 Exercise I9 - Count the number of matches

Regex 101 Exercise I9 - Count the number of matches Given a string like: # # 4 6 # # 7 # 45 # 43 # 65 56 2 # 4345 # # 23 Count how many numbers there are in this string
Posted by ericgu | 9 Comments

Regex 101 Discussion I8 - replace space count with spaces

Exercise I8 - replace space count with spaces Given a string with embedded space counts: <15sp>Indented by 15 spaces Replace the <<count>sp> with <count> spaces. So, if you have <4sp>Text you should end up with Text *******
Posted by ericgu | 1 Comments

Regex 101 Exercise I8 - replace space count with spaces

Exercise I8 - replace space count with spaces Given a string with embedded space counts: <15sp>Indented by 15 spaces Replace the <<count>sp> with <count> spaces. So, if you have <4sp>Text you should end up with Text
Posted by ericgu | 14 Comments

Regex 101 Discussion I7 - Make sure all characters inside <> are uppercase

Regex 101 Exercise I7 - Make sure all characters inside <> are uppercase First, as Sheva pointed out, making them all *lowercase* would make a lot more sense, but you have probably noticed that the correlation between these exercises and making
Posted by ericgu | 4 Comments

Regex 101 Exercise I7 - Make sure all characters inside <> are uppercase

Regex 101 Exercise I7 - Make sure all characters inside <> are uppercase
Posted by ericgu | 10 Comments

Regex 101 Discussion I6 - Remove font directives from HTML

Regex 101 Exercise I6 - Remove font directives from HTML Remove all <font…> or </font> directives from an HTML string. ***** I've decided to start linking my answers back to the original posts, since the answers given there are often as good
Posted by ericgu | 0 Comments

Regex 101 Exercise I6 - Remove font directives from HTML

Regex 101 Exercise I6 - Remove font directives from HTML Remove all <font…> or </font> directives from an HTML string.
Posted by ericgu | 7 Comments

Regex 101 Discussion I5 - Remove unapproved HTML tags from a string

When accepting HTML input from a user, allow the following tags: <b> </b> <a href=…> </a> <i> </i> <u> </u> and remove any others. ****** My first comment is that you should be very careful when you do this
Posted by ericgu | 14 Comments

Regex 101 Exercise I5 - Remove unapproved HTML tags from a string

Regex 101 Exercise I5 - Remove unapproved HTML tags from a string When accepting HTML input from a user, allow the following tags: <b> </b> <a href=…> </a> <i> </i> <u> </u> and remove any others.
Posted by ericgu | 16 Comments
More Posts Next page »
 
Page view tracker