mirror of
https://github.com/ziishaned/learn-regex.git
synced 2025-08-06 03:26:42 -04:00
Update README.md
This commit is contained in:
parent
ce306ec8b3
commit
e24dbe5541
@ -10,7 +10,9 @@ Imagine you are writing an application and you want to set the rules when user c
|
|||||||
contains letter, number, underscore and hyphen. We also want to limit the number of characters in username so it does not look ugly.
|
contains letter, number, underscore and hyphen. We also want to limit the number of characters in username so it does not look ugly.
|
||||||
We use the following regular expression to validate a username:
|
We use the following regular expression to validate a username:
|
||||||
|
|
||||||
<img align="center" src="https://i.imgur.com/UrDb9qc.png" alt="Regular expression">
|
<p align="center">
|
||||||
|
<img src="https://i.imgur.com/UrDb9qc.png" alt="Regular expression">
|
||||||
|
</p>
|
||||||
|
|
||||||
Above regular expression can accepts the strings "john_doe", "jo-hn\_doe" and "john12\_as". It does not match "Jo" because that string
|
Above regular expression can accepts the strings "john_doe", "jo-hn\_doe" and "john12\_as". It does not match "Jo" because that string
|
||||||
contains uppercase letter and also it is too short.
|
contains uppercase letter and also it is too short.
|
||||||
@ -103,4 +105,4 @@ lowercase letters in a row.
|
|||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
"[a-z]+" => <strong><u>The</u></strong> <strong><u>car</u></strong> <strong><u>parked</u></strong> <strong><u>in</u></strong> <strong><u>the</u></strong> <strong><u>garage</u></strong>.
|
"[a-z]+" => <strong><u>The</u></strong> <strong><u>car</u></strong> <strong><u>parked</u></strong> <strong><u>in</u></strong> <strong><u>the</u></strong> <strong><u>garage</u></strong>.
|
||||||
</pre>
|
</pre>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user