Regular Expression Tester

Regular Expression

/ /
Common flags: g (global), i (ignore case), m (multiline), s (dotall), u (unicode)

Test String

Test Results

Enter a regex pattern and test string to see results
Matches 0
Highlighted Text
Regex Quick Reference
Character Classes
  • . - Any character except newline
  • \d - Any digit (0-9)
  • \w - Any word character (a-z, A-Z, 0-9, _)
  • \s - Any whitespace character
  • [abc] - Any character a, b, or c
  • [^abc] - Any character except a, b, or c
  • [a-z] - Any lowercase letter
Quantifiers
  • * - 0 or more
  • + - 1 or more
  • ? - 0 or 1
  • {3} - Exactly 3
  • {3,} - 3 or more
  • {3,5} - Between 3 and 5
Anchors
  • ^ - Start of string/line
  • $ - End of string/line
  • \b - Word boundary
  • \B - Not word boundary
Common Patterns
Match Details

Click on a match to see details

Professional Regex Tester - Test Regular Expressions Online

Test and debug regular expressions with our comprehensive regex testing tool. Features real-time matching, syntax highlighting, and detailed match information with support for all JavaScript regex flags.

Regex Tester Features

  • Real-time regex pattern testing and validation
  • Support for all JavaScript regex flags (g, i, m, s, u, y)
  • Visual match highlighting in test text
  • Detailed match information including groups and positions
  • Common regex pattern library for quick testing
  • Comprehensive regex syntax reference
  • Error handling and syntax validation

Regular Expression Use Cases

  • Form validation (email, phone, URL validation)
  • Text parsing and data extraction
  • Search and replace operations
  • Log file analysis and filtering
  • Code syntax highlighting and parsing
  • Data cleaning and normalization
  • Web scraping and content extraction

Regex Best Practices

  • Start simple and build complexity gradually
  • Use non-capturing groups (?:...) when you don't need the capture
  • Be specific with character classes instead of using .*
  • Use anchors (^ and $) to ensure full string matching
  • Test with edge cases and unexpected input
  • Consider performance implications of complex patterns

Вопросы про regex

Поиск паттернов в тексте. Валидация email'ов, извлечение данных, поиск-замена с условиями, парсинг логов — везде, где нужно "найти именно такой паттерн".

. = любой символ. * = ноль или более. + = один или более. ? = опционально. ^/$ = начало/конец. \d = цифра. \w = буква/цифра. [abc] = любой из a, b, c. Это покрывает 80% случаев.

Добавьте флаг 'i'. В JavaScript это /pattern/i. В этом инструменте есть чекбокс.

Скорее всего забыли экранировать спецсимвол (. матчит ВСЁ, не точку), или паттерн жадный когда должен быть ленивым (.*? vs .*). Живой превью здесь помогает отлаживать.