Regex на примерах: поиск, проверка, замена

Regex на примерах: поиск, проверка, замена

Decks
Free
Знаток
Знаток
•
101 + 101 cards
Практическая колода по регулярным выражениям на живых кейсах: поиск чисел, email, дат, пробелов, замены текста и проверка строк на понятных реальных шаблонах.
For practitioners
Clear definitions
Learn effectively and remember long-term
View
101 + 101 cards
Demo training: 1 of 10
Last updated: April 2026
Try to remember the answer yourself. If necessary, open the hint, then click on the card to see the answer. Click ✓ if you answered correctly, or × if you made a mistake. The full version is available after .
Demo: Flashcards
1/10
Term / Question
...
Translation / Answer
...
Space - flip, click on the card - flip. You can choose the answer immediately.
← Don't know
Easy →

More features available after registration

Customize your learning, track progress and memory statistics, use different testing methods and spaced repetition. Create private decks just for yourself or share them with others, study ready-made decks and courses. And a daily five-minute warmup and trainers will help activate your attention and memory before studying or working.

Demo: Testing
1/10
Term / Question
...
Translation / Answer
...
Space - flip, click on the card - flip. You can choose the answer immediately.
← Don't know
Easy →

View

Term / Question
\d+
Hint: поиск чисел в тексте
Context: The pattern \d+ matches 123 in "abc123def". - Шаблон \d+ находит 123 в строке "abc123def".
Translation / Answer
найти число подряд (одна или более цифр)
Term / Question
\b\d+\b
Hint: число как самостоятельный фрагмент
Context: The pattern \b\d+\b matches 42 in "Item 42 is ready". - Шаблон \b\d+\b находит 42 в строке "Item 42 is ready".
Translation / Answer
найти отдельное число (не часть слова)
Term / Question
-?\d+
Hint: подходит для -15 и 20
Context: The pattern -?\d+ matches -15 in "Value: -15". - Шаблон -?\d+ находит -15 в строке "Value: -15".
Translation / Answer
найти целое число со знаком минус или без него
Term / Question
\+?\d+
Hint: подходит для +7 и 7
Context: The pattern \+?\d+ matches +7 in "Code +7". - Шаблон \+?\d+ находит +7 в строке "Code +7".
Translation / Answer
найти число с необязательным плюсом в начале
Term / Question
\d+\.\d+
Hint: простая форма 12.75
Context: The pattern \d+\.\d+ matches 12.75 in "Price 12.75 USD". - Шаблон \d+\.\d+ находит 12.75 в строке "Price 12.75 USD".
Translation / Answer
найти десятичное число с точкой
Term / Question
\b\d{4}\b
Hint: часто для годов
Context: The pattern \b\d{4}\b matches 2025 in "Year 2025". - Шаблон \b\d{4}\b находит 2025 в строке "Year 2025".
Translation / Answer
найти год из четырёх цифр
Term / Question
\b\d{2}:\d{2}\b
Hint: часы и минуты без строгой проверки диапазона
Context: The pattern \b\d{2}:\d{2}\b matches 09:45 in "Meet at 09:45". - Шаблон \b\d{2}:\d{2}\b находит 09:45 в строке "Meet at 09:45".
Translation / Answer
найти время в форме 12:34
Term / Question
\b\d{4}-\d{2}-\d{2}\b
Hint: ISO-подобная дата
Context: The pattern \b\d{4}-\d{2}-\d{2}\b matches 2025-12-31. - Шаблон \b\d{4}-\d{2}-\d{2}\b находит 2025-12-31.
Translation / Answer
найти дату формата 2025-12-31
Term / Question
\b\d{2}/\d{2}/\d{4}\b
Hint: день/месяц/год
Context: The pattern \b\d{2}/\d{2}/\d{4}\b matches 31/12/2025. - Шаблон \b\d{2}/\d{2}/\d{4}\b находит 31/12/2025.
Translation / Answer
найти дату формата 31/12/2025
Term / Question
\b\d{1,2}[./-]\d{1,2}[./-]\d{4}\b
Hint: допускает ., / и -
Context: The pattern \b\d{1,2}[./-]\d{1,2}[./-]\d{4}\b matches 01-05-2025. - Шаблон \b\d{1,2}[./-]\d{1,2}[./-]\d{4}\b находит 01-05-2025.
Translation / Answer
найти дату с разными разделителями
Term / Question
\w+@\w+\.\w+
Hint: не строгая, но наглядная форма
Context: The pattern \w+@\w+\.\w+ matches test@example.com. - Шаблон \w+@\w+\.\w+ находит test@example.com.
Translation / Answer
найти простой email в тексте
Term / Question
^[^@]+@[^@]+\.[^@]+$
Hint: вся строка должна быть email
Context: The pattern ^[^@]+@[^@]+\.[^@]+$ matches "a@b.com". - Шаблон ^[^@]+@[^@]+\.[^@]+$ находит "a@b.com".
Translation / Answer
простая проверка email целиком
Term / Question
https?://\S+
Hint: до первого пробела
Context: The pattern https?://\S+ matches https://example.com/page. - Шаблон https?://\S+ находит https://example.com/page.
Translation / Answer
найти ссылку http или https
Term / Question
^https?://\S+$
Hint: простая полная проверка URL
Context: The pattern ^https?://\S+$ matches "https://example.com". - Шаблон ^https?://\S+$ находит "https://example.com".
Translation / Answer
проверить, что строка целиком является ссылкой
Term / Question
#\w+
Hint: решётка и слово после неё
Context: The pattern #\w+ matches #news in "Today #news". - Шаблон #\w+ находит #news в строке "Today #news".
Translation / Answer
найти хештег
Term / Question
@\w+
Hint: собачка и имя после неё
Context: The pattern @\w+ matches @alice in "Hi @alice". - Шаблон @\w+ находит @alice в строке "Hi @alice".
Translation / Answer
найти упоминание пользователя
Term / Question
\b[A-Z]{2}\d{4}\b
Hint: пример номера или артикула
Context: The pattern \b[A-Z]{2}\d{4}\b matches AB1234. - Шаблон \b[A-Z]{2}\d{4}\b находит AB1234.
Translation / Answer
найти код из двух букв и четырёх цифр
Term / Question
\b[a-fA-F0-9]{8}\b
Hint: например кусок хеша
Context: The pattern \b[a-fA-F0-9]{8}\b matches 1a2b3c4d. - Шаблон \b[a-fA-F0-9]{8}\b находит 1a2b3c4d.
Translation / Answer
найти короткий hex-идентификатор
Term / Question
\b\d{1,3}(?:\.\d{1,3}){3}\b
Hint: форма есть, но 255 не проверяет
Context: The pattern \b\d{1,3}(?:\.\d{1,3}){3}\b matches 192.168.0.1. - Шаблон \b\d{1,3}(?:\.\d{1,3}){3}\b находит 192.168.0.1.
Translation / Answer
найти IPv4 по форме
Term / Question
\b[a-zA-Z]:\\[^\r\n]*
Hint: буква диска и обратные слэши
Context: The pattern \b[a-zA-Z]:\\[^\r\n]* matches C:\Temp\file.txt. - Шаблон \b[a-zA-Z]:\\[^\r\n]* находит C:\Temp\file.txt.
Translation / Answer
найти Windows-путь
Term / Question
\/[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*
Hint: простая форма пути
Context: The pattern \/[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)* matches /var/log/nginx. - Шаблон \/[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)* находит /var/log/nginx.
Translation / Answer
найти Unix-путь
Term / Question
\b\w+\.\w+\b
Hint: простая форма filename.ext
Context: The pattern \b\w+\.\w+\b matches file.txt. - Шаблон \b\w+\.\w+\b находит file.txt.
Translation / Answer
найти имя файла с расширением
Term / Question
\.([A-Za-z0-9]+)$
Hint: захват после точки
Context: The pattern \.([A-Za-z0-9]+)$ captures txt in "file.txt". - Шаблон \.([A-Za-z0-9]+)$ захватывает txt в строке "file.txt".
Translation / Answer
вытащить расширение файла в конце строки
Term / Question
^.+\.[A-Za-z0-9]+$
Hint: в строке должна быть точка и расширение
Context: The pattern ^.+\.[A-Za-z0-9]+$ matches "report.pdf". - Шаблон ^.+\.[A-Za-z0-9]+$ находит "report.pdf".
Translation / Answer
проверить, что строка похожа на имя файла с расширением

Examples of flashcards from the deck in a table

Below you can quickly view flashcards in this deck as a table: term, hint, example and answer. Use search to find the card you need, or hide answers for self-testing. The full set of flashcards is available after logging into Memoro.

Term / Question Hint Context Translation / Answer
\d+ поиск чисел в тексте The pattern \d+ matches 123 in "abc123def". - Шаблон \d+ находит 123 в строке "abc123def". найти число подряд (одна или более цифр)
\b\d+\b число как самостоятельный фрагмент The pattern \b\d+\b matches 42 in "Item 42 is ready". - Шаблон \b\d+\b находит 42 в строке "Item 42 is ready". найти отдельное число (не часть слова)
-?\d+ подходит для -15 и 20 The pattern -?\d+ matches -15 in "Value: -15". - Шаблон -?\d+ находит -15 в строке "Value: -15". найти целое число со знаком минус или без него
\+?\d+ подходит для +7 и 7 The pattern \+?\d+ matches +7 in "Code +7". - Шаблон \+?\d+ находит +7 в строке "Code +7". найти число с необязательным плюсом в начале
\d+\.\d+ простая форма 12.75 The pattern \d+\.\d+ matches 12.75 in "Price 12.75 USD". - Шаблон \d+\.\d+ находит 12.75 в строке "Price 12.75 USD". найти десятичное число с точкой
\b\d{4}\b часто для годов The pattern \b\d{4}\b matches 2025 in "Year 2025". - Шаблон \b\d{4}\b находит 2025 в строке "Year 2025". найти год из четырёх цифр
\b\d{2}:\d{2}\b часы и минуты без строгой проверки диапазона The pattern \b\d{2}:\d{2}\b matches 09:45 in "Meet at 09:45". - Шаблон \b\d{2}:\d{2}\b находит 09:45 в строке "Meet at 09:45". найти время в форме 12:34
\b\d{4}-\d{2}-\d{2}\b ISO-подобная дата The pattern \b\d{4}-\d{2}-\d{2}\b matches 2025-12-31. - Шаблон \b\d{4}-\d{2}-\d{2}\b находит 2025-12-31. найти дату формата 2025-12-31
\b\d{2}/\d{2}/\d{4}\b день/месяц/год The pattern \b\d{2}/\d{2}/\d{4}\b matches 31/12/2025. - Шаблон \b\d{2}/\d{2}/\d{4}\b находит 31/12/2025. найти дату формата 31/12/2025
\b\d{1,2}[./-]\d{1,2}[./-]\d{4}\b допускает ., / и - The pattern \b\d{1,2}[./-]\d{1,2}[./-]\d{4}\b matches 01-05-2025. - Шаблон \b\d{1,2}[./-]\d{1,2}[./-]\d{4}\b находит 01-05-2025. найти дату с разными разделителями
\w+@\w+\.\w+ не строгая, но наглядная форма The pattern \w+@\w+\.\w+ matches test@example.com. - Шаблон \w+@\w+\.\w+ находит test@example.com. найти простой email в тексте
^[^@]+@[^@]+\.[^@]+$ вся строка должна быть email The pattern ^[^@]+@[^@]+\.[^@]+$ matches "a@b.com". - Шаблон ^[^@]+@[^@]+\.[^@]+$ находит "a@b.com". простая проверка email целиком
https?://\S+ до первого пробела The pattern https?://\S+ matches https://example.com/page. - Шаблон https?://\S+ находит https://example.com/page. найти ссылку http или https
^https?://\S+$ простая полная проверка URL The pattern ^https?://\S+$ matches "https://example.com". - Шаблон ^https?://\S+$ находит "https://example.com". проверить, что строка целиком является ссылкой
#\w+ решётка и слово после неё The pattern #\w+ matches #news in "Today #news". - Шаблон #\w+ находит #news в строке "Today #news". найти хештег
@\w+ собачка и имя после неё The pattern @\w+ matches @alice in "Hi @alice". - Шаблон @\w+ находит @alice в строке "Hi @alice". найти упоминание пользователя
\b[A-Z]{2}\d{4}\b пример номера или артикула The pattern \b[A-Z]{2}\d{4}\b matches AB1234. - Шаблон \b[A-Z]{2}\d{4}\b находит AB1234. найти код из двух букв и четырёх цифр
\b[a-fA-F0-9]{8}\b например кусок хеша The pattern \b[a-fA-F0-9]{8}\b matches 1a2b3c4d. - Шаблон \b[a-fA-F0-9]{8}\b находит 1a2b3c4d. найти короткий hex-идентификатор
\b\d{1,3}(?:\.\d{1,3}){3}\b форма есть, но 255 не проверяет The pattern \b\d{1,3}(?:\.\d{1,3}){3}\b matches 192.168.0.1. - Шаблон \b\d{1,3}(?:\.\d{1,3}){3}\b находит 192.168.0.1. найти IPv4 по форме
\b[a-zA-Z]:\\[^\r\n]* буква диска и обратные слэши The pattern \b[a-zA-Z]:\\[^\r\n]* matches C:\Temp\file.txt. - Шаблон \b[a-zA-Z]:\\[^\r\n]* находит C:\Temp\file.txt. найти Windows-путь
\/[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)* простая форма пути The pattern \/[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)* matches /var/log/nginx. - Шаблон \/[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)* находит /var/log/nginx. найти Unix-путь
\b\w+\.\w+\b простая форма filename.ext The pattern \b\w+\.\w+\b matches file.txt. - Шаблон \b\w+\.\w+\b находит file.txt. найти имя файла с расширением
\.([A-Za-z0-9]+)$ захват после точки The pattern \.([A-Za-z0-9]+)$ captures txt in "file.txt". - Шаблон \.([A-Za-z0-9]+)$ захватывает txt в строке "file.txt". вытащить расширение файла в конце строки
^.+\.[A-Za-z0-9]+$ в строке должна быть точка и расширение The pattern ^.+\.[A-Za-z0-9]+$ matches "report.pdf". - Шаблон ^.+\.[A-Za-z0-9]+$ находит "report.pdf". проверить, что строка похожа на имя файла с расширением

Get access to all cards

Register for free to unlock all 101 cards and start learning without limits.