Regular Expression or RegEx or RegExp

What is a Regular Expression or RegEx or RegExp ?
A regular expression is a special text string for describing a search pattern. Regular expressions are used in search engines, search and replace dialogs of word processors and text editors. Many programming languages provide regex capabilities, built-in, or via libraries.
The phrase regular expressions is often used to mean the specific, standard textual syntax for representing patterns that matching text need to conform to. Each character in a regular expression (that is, each character in the string describing its pattern) is understood to be a metacharacter (with its special meaning), or a regular character (with its literal meaning).


abc…
Letters
123…
Digits
\d
Any Digit
\D
Any Non-digit character
.
Any Character
\.
Period
[abc]
Only a, b, or c
[^abc]
Not a, b, nor c
[a-z]
Characters a to z
[0-9]
Numbers 0 to 9
\w
Any Alphanumeric character
\W
Any Non-alphanumeric character
{m}
m Repetitions
{m,n}
m to n Repetitions
*
Zero or more repetitions
+
One or more repetitions
?
Optional character
\s
Any Whitespace
\S
Any Non-whitespace character
^…$
Starts and ends
(…)
Capture Group
(a(bc))
Capture Sub-group
(.*)
Capture all
(abc|def)
Matches abc or def

The Dot ( . ) - Any character
    The dot ( . ) represents any character.

The ' .* ' matches zero or more of any character. 

Here the ' . ' matches only a single character.

Here the ' .. ' matches only a two characters.


Here the searching of 'th' characters.


Range
    Matches a character having a character code between the two specified characters inclusive.
Range of digits

Range of small alphabets

Range of capital alphabets

Range of digits, small alphabets, capital alphabets

Range with Repetitions {m}

Range with zero or more Repetitions ' * '

Negated set [^ ]
     Match any character that is not in the set.

Plus ( + )
     Matches 1 or more of the preceding token.

Alternation ( | ) and Optional ( ? )
     Acts like a boolean OR. Matches the expression before or after the |. 
Optional matches 0 or 1 of the preceding token, effectively making it optional.

Optional ( ? )

Quantifier {m,n}
     Matches the specified quantity of the previous token. {1,2} will match 1 to 2.

Anchors ( ^  $ )
   ' ^ '  matches the beginning of the string, or the beginning of a line.
   ' $ ' matches the end of the string, or the end of a line.

Regular expression for email id

To detect the below string:-
200 6248

Regular Expression is
[0-9]{3}\s[0-9]{4}

[0-9] -> range between 0-9
  {3}  -> 3 times digit
   \s    -> space character

To detect the below string:-
123.123.123.123

Regular Expression is
[0-9]{3}\.[0-9]{3}\.[0-9]{3}\.[0-9]{3}
[0-9] -> range between 0-9
  {3}  -> 3 times digit
   \.    -> Escape Dot (.) seperator

To detect the below string:-
[26/Apr/2000:00:23:48 -0400]

Regular Expression is
\[[0-9]{2}\W[A-Za-z]{3}\W[0-9]{4}\:[0-9]{2}\:[0-9]{2}\:[0-9]{2}\s\-[0-9]{4}\]
[0-9] -> range between 0-9
  {4}  ->4 times digit
   \[    -> Escape charactor  ' [ '
   \]    -> Escape charactor  ' ] '
   \:    -> Escape charactor  ' : '
   \W -> Escape special charactor

Comments

  1. Wow easy to understand.Good

    ReplyDelete
    Replies
    1. Regular Expression Or Regex Or Regexp >>>>> Download Now

      >>>>> Download Full

      Regular Expression Or Regex Or Regexp >>>>> Download LINK

      >>>>> Download Now

      Regular Expression Or Regex Or Regexp >>>>> Download Full

      >>>>> Download LINK OV

      Delete
  2. got a perfect view of regex,helpful to me
    thank you.

    ReplyDelete
  3. nice very useful article thank you for sharing.
    Hadoop Tutorials

    ReplyDelete
  4. Excellent Blog very imperative good content, this article is useful to beginners and real time
    employees.Thank u for sharing...
    Hadoop Training in Hyderabad

    ReplyDelete
  5. Nice.very useful information .Thank you for sharing big data hadoop online training

    ReplyDelete
  6. thank you for sharing such a good and useful information, please keep on share like this
    hadoop training in hyderabad
    hadoop online training
    hadoop training in ameerpet

    ReplyDelete
  7. Really nice blog post.provided a helpful information.I hope that you will post more updates like thisBig data hadoop online Training India

    ReplyDelete
  8. The blog is so interactive and Informative , i Request you to write more blogs like thisHadoop Admin Online course

    ReplyDelete
  9. Really nice blog post.provided a helpful information.I hope that you will post more updates like thisBig Data Hadoop Online Training Hyderabad

    ReplyDelete
  10. It is really a great work and the way in which you are sharing the knowledge is excellent.

    big data analytics company in hyderabad

    ReplyDelete
  11. APTRON Gurgaon teach you everything about Hadoop right from the earliest starting point to the very advanced level so you can be efficient with your work in challenging situations.
    For More Info: Hadoop Course in Gurgaon

    ReplyDelete
  12. Regular Expression Or Regex Or Regexp >>>>> Download Now

    >>>>> Download Full

    Regular Expression Or Regex Or Regexp >>>>> Download LINK

    >>>>> Download Now

    Regular Expression Or Regex Or Regexp >>>>> Download Full

    >>>>> Download LINK fH

    ReplyDelete
  13. Thank you for sharing such an informative post.
    I am Cindy jones. I am Completing my B.pharm and M.Pharm for USA university. Currently, I am working at Mygenmeds pharmacy. Our pharmacy sells All ED Medicine at an affordable price. Mygenmeds is the best website for buying generic pills online. Most effective pills for Ed - Tadalista 20 | Cenforce 120 | Vidalista 40

    ReplyDelete
  14. Cryptocurrency App Development Company is a subset of digital currency designed to serve as an exchange mechanism for secure online transactions via cryptography. Bitcoin is the world's first decentralized record currency. It has been a huge success, with a good response from the global community. It has prepared the path for the emergence of new cryptocurrencies. These digital currencies are also known as Bitcoin forks.

    ReplyDelete
  15. A Dedicated Server is a physical server that's assigned to a single organization.

    ReplyDelete

Post a Comment