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.


Archive for April, 2009

Understanding Regular Expressions metacharacters with uses


Understanding Regular Expressions metacharacters with uses

The ^ (caret) metacharacter – Start of a string

^ (caret) metacharacter matches the characters that occur immediately after the beginning of a line or string.

Suppose we want to search "we"
Text Pattern is – we have holiday on wednesday

It will match the sequence of characters "we" in the words we, and wednesday. However, the same pattern preceded by the ^ metacharacter means "^we" when applied to the same Text Pattern. It will match the sequence of characters "we" occurs immediately after the start of the string.

The $ (dollar) metacharacter – End of a string

$ (dollar) metacharacter matches the characters that immediately precede the end of a line or string.

Suppose we want to search "day"
Text Pattern is – Today we have office but we have holiday on wednesday

It will match the sequence of characters "day" in the words Today, holiday and wednesday. However, the same pattern processed with the $ metacharacter means "day$" when applied to the same Text Pattern. It will match the sequence of characters "day" occurs at the end of a line in the words wednesday.


Read the rest of this entry »

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.


Read the rest of this entry »

Matching literal (normal) text characters with Regular Expressions


Matching literal (normal) text characters with Regular Expressions

Basically regex are used to search a character, word, string or string pattern. Here we are going to search for a single literal character. Consider we want search for "o" in the string patter "Poonam like mango". It will match the "o" after the "P". The default behavior of most regular expression engines is to return just the first match. Though this regex can match the second "o" too. Most regex implementations provide a mechanism by which we can obtain a list of all matches when the regex engine start searching through the string after the first match.


Read the rest of this entry »

What is Regular expression engines


What is Regular expression engines

The primry work of searching any regular expression pattern is done by Regular expression engines. Regular expression engines have differences based on their type and way of there working. There are mainly two Regular expression engines: Deterministic Finite Automaton (DFA) and Nondeterministic Finite Automaton (NFA). DFAs are faster, but lack many of the features of an NFA, such as capturing, look around, and non greedy quantifiers. The NFA further categories in two sub types: traditional NFA and POSIX.

Deterministic Finite Automaton (DFA) regex engines

DFAs compare each character of the input string to the regular expression, keeping track of all matches in progress. Since each character is examined at most once, the DFA engine is the fastest.


Read the rest of this entry »

What is Regular Expressions, an Introduction to Regular Expressions


What is Regular Expressions, an Introduction to Regular Expressions

Regular expressions(or regex) are a language used for more sophisticated form and text processing. They are often used to perform complex search-and-replace operations, and to validate that text data is well-formed. Regular expressions can be used to perform all sorts of powerful text processing and manipulation in just about every language and on every platform. Every regular expression either matches text (search) or matches and replaces text (search and replace).

Today, regular expressions are supported by most programming languages, as well as many scripting languages (like Perl, ASP, Visual Basic, .NET, C#, Java, JSP, PHP,Python, ColdFusion, Tcl, Ruby and many other languages), editors (EmEditor, TextPad), applications (Microsoft Word, Microsoft Excel, StarOffice, OpenOffice), databases(MySQL, SQL Server), and command-line tools.


Read the rest of this entry »