The Unix and Linux regular expression is also call regex or regexp. It is a very powerful tool in Linux.
Regular expression is a pattern for a matching string that follows some pattern.
Regex can be use in a variety of programs like grep, sed, vi, bash, rename and many more. Which are describe previous articles.
If you understand clear concept, you can read that article. I hope it is very helpful for every linux user. Regular Expression Meta characters.
The regular expression may have one or several repeating meta characters.
Now we can clearly understand this concept which are show below :
. Replaces any character.
^ Matches start of string and represents characters not in the string.
$ Matches end of string.
- Matches zero or more times the preceding character.
\ Represents the group of characters.
() Groups regular expressions.
? Matches exactly one character. - Matches one or more times the preceding character.
{N} Preceding character is matched exactly N times.
{N,} Preceding character is matched exactly N times or more.
{N,M} Preceding character is matched exactly N times, but not more than N times. - Represents the range.
\b Matches empty string at the edge of a word.
\B Matches empty string if it is not at the edge of a word.
\< Matches empty string at the beginning of a word.
> Empty string at the end of a word.
Regex Versions
There are three versions of regular expressions syntax of :
BRE : Basic Regular Expressions
ERE : Extended Regular Expressions
PRCE: Perl Regular Expressions
Depending on tool or programs, one or more of these versions can be use.
Regex means regular expression. Regular expressions are use in search engines, search and replace dialogs of word processors and text editor.
It is so much important tools in Unix or Linux systems. It is also helpful for every Unix and Linux users. If you understand this article, then you can practice on your terminal of the Unix or Linux environment. Thank you.