Tips n Tracks

  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • black color

Reference

Sample image

Microsoft .NET Framework Get Details.

Sample image

Microsoft .NET Framework Get Details.

Reference

Sample image Microsoft .NET Framework Get Details.
Sample image

Microsoft .NET Framework Get Details.


Matching text with Special meta-characters using Regular Expressions


Matching text with Special meta-characters using Regular Expressions

Regex are more powerful and we want to do more than simply search for literal pieces of text. There are certain reserved meta-characters with Special uses and meaning. These "metacharacters" are: the square bracket [...], the backslash \, the caret ^, the dollar sign $, the period or dot ., the vertical bar or pipe symbol |, the question mark ?, the asterisk or star *, the plus sign +, the round bracket (…) and the Curly Brace {…}.

Below table well explain us with the usability of each metacharacter.

Table 1: Regular Expressions Metacharacters
meta-character Definition ( or Use)
^ Start of a string.
$ End of a string.
. . Any character (except \n newline)
| Alternation: state to another and back again.
{…} Explicit quantifier notation.
{n} Repeat n times.
{n,m} Repeat at least n, but no more than m times.
{n,} Repeat at least n times.
(…) Explicit set of characters to match.
* Repeat any number of times.
+ Repeat one or more times.
? Repeat zero or one time
\ Preceding "\" makes all the metacharacter as a literal instead of a special character.

 

Chetan love blogging. He regularly blogs at http://www.tipsntracks.com. You can connect with Chetan on Twitter, Facebook and Google Plus...

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

[...] Matching text with Special meta-characters using Regular Expressions [...]

Pingback by Text and Data Manipulation with Regular Expressions in .NET Development | Tips n Tracks on December 16, 2009 @ 12:37 am

Leave a comment

(required)

(required)

*
To prove that you're not a bot, enter this code
Anti-Spam Image