-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7557de1
commit 03d8647
Showing
2 changed files
with
16 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
![alt-текст](https://pictures.s3.yandex.net/frontend-developer/dom_bom/logo.svg "Yandex Prakticum - Регулярные выражения"); | ||
# Form Validation - https://dmitriyshvanyk.github.io/form/ | ||
## Version 1.0.1 | ||
## Version 1.0.2 | ||
|
||
## 1. Regex Имя | ||
```^[А-ЯЁ][а-яё]*(-?[А-ЯЁ][а-яё]*)*$``` | ||
### [Test][1] | ||
[1]: https://regex101.com/r/bLJqBH/1 | ||
|
||
## 2. Regex E-Mail | ||
```^[a-z0-9._+-]{2,}?@[a-z0-9.-]{2,}?\.[a-z]{2,}$``` | ||
```^[a-z0-9]{1,}?[_-]?[a-z0-9]{1,}?\@[a-z0-9]{1,}?\-?[a-z0-9]{1,}?\.[a-z]{2,}$``` | ||
### [Test][2] | ||
[2]: https://regex101.com/r/x3TZml/1 | ||
|
||
## 3. Regex Телефон | ||
```^\+?[7|8]+?[(|\s]?[0-9]{3}?[)|-]?[\s]?[0-9]{3}?[-\s\.]?[0-9]{2}?[-\s\.]?[0-9]{2}$``` | ||
|
||
### [Test][3] | ||
[3]: https://regex101.com/r/oQ3YG4/1 | ||
|
||
## 4. Regex Url сайта | ||
```^[(https?):\/\/]?[www.]?(([0-9]{1,3}?[\.]?[0-9]{1,3}?[\.]?[0-9]{1,3}?[\.]?[0-9]{1,3}?[\.])|([\w]{2,}?[\.]?[\w]{2,}))?([\:]?[0-9]{2,5})?[\#]{1}$``` | ||
```^((https?):\/\/)(www.)*(([a-z]{2,}?\.?[a-z]{2,})|((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})?(\:\d{2,5})*))?(\/?[a-z0-9-]?\.?[a-z]{2,})*?[#]*$``` | ||
### [Test][4] | ||
[4]: https://regex101.com/r/182wxC/1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,12 +22,12 @@ <h1 class="cover__heading">RegExp</h1> | |
<h3>Форма регистрации</h3> | ||
<fieldset class="form__fieldset"> | ||
<div class="form__field"> | ||
<input class="form__input" type="text" name="name" minlength="2" maxlength="30" | ||
pattern="^[А-ЯЁ][а-яё]*(-?[А-ЯЁ][а-яё]*)*$" placeholder="Имя" required> | ||
<input class="form__input" type="text" name="name" minlength="2" maxlength="30" | ||
pattern="^[А-ЯЁ][а-яё]*(-?[А-ЯЁ][а-яё]*)*$" placeholder="Имя" required> | ||
</div> | ||
<div class="form__field"> | ||
<input class="form__input" type="email" name="name" | ||
pattern="^[a-z0-9._+-]{2,}?@[a-z0-9.-]{2,}?\.[a-z]{2,}$" placeholder="E-Mail"> | ||
pattern="^[a-z0-9]{1,}?[_-]?[a-z0-9]{1,}?\@[a-z0-9]{1,}?\-?[a-z0-9]{1,}?\.[a-z]{2,}$" placeholder="E-Mail"> | ||
<span class="form__error">e-mail в формате: [email protected]</span> | ||
</div> | ||
<div class="form__field"> | ||
|
@@ -38,7 +38,7 @@ <h3>Форма регистрации</h3> | |
</div> | ||
<div class="form__field"> | ||
<input class="form__input" type="url" name="name" | ||
pattern="^[(https?):\/\/]?[www.]?(([0-9]{1,3}?[\.]?[0-9]{1,3}?[\.]?[0-9]{1,3}?[\.]?[0-9]{1,3}?[\.])|([\w]{2,}?[\.]?[\w]{2,}))?([\:]?[0-9]{2,5})?[\#]{1}$" | ||
pattern="^((https?):\/\/)(www.)*(([a-z]{2,}?\.?[a-z]{2,})|((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})?(\:\d{2,5})*))?(\/?[a-z0-9-]?\.?[a-z]{2,})*?[#]*$" | ||
placeholder="Ваш сайт"> | ||
<span class="form__error">URL в формате: http://mysite.ru</span> | ||
</div> | ||
|
03d8647
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Я написал ответ на вопросы в коммите прошлой проверки. Пожалуйста, ознакомьтесь.