6/11/2012

Regex quick reference

[abc] A single character of: a, b or c [^abc] Any single character except: a, b, or c [a-z] Any single character in the range a-z [a-zA-Z] Any single character in the range a-z or A-Z ^ Start of line $ End of line \A Start of string \z End of string . Any single character \s Any whitespace character \S Any non-whitespace character \d Any digit \D Any non-digit \w Any word character (letter, number, underscore) \W Any non-word character \b Any word boundary character (...) Capture everything enclosed (a|b) a or b a? Zero or one of a a* Zero or more of a a+ One or more of a a{3} Exactly 3 of a a{3,} 3 or more of...

Save And Share :

Remove Html Tag in C#

You want to remove HTML tags from your string. This is useful for displaying HTML in plain text and stripping formatting like bold and italics, while not removing any actual textual content. Test the methods available for this functionality for performance and correctness with test cases. These C# example programs show how to remove HTML tags from strings.Removing HTML tags from strings Input: <p>The <b>dog</b> is <i>cute</i>.</p> Output: The dog is cute. Performance test for HTML removal HtmlRemoval.StripTagsRegex: 2404 ms HtmlRemoval.StripTagsRegexCompiled: 1366 ms HtmlRemoval.StripTagsCharArray:...

Save And Share :

Remove Html Tag with jQuery

The example below show how to remove HTML tags from strings with jQuery   INPUT:         <b>We</b>love<span>jQuery.</span> OUTPUT:   We love jQuery. jQuery source: var NewString = OriginalString.replace(/(<([^>]+)>)/ig, "");...

Save And Share :

 
  • It's fine to celebrate success but it is more important to heed the lessons of failure.

  • Followers