Php regexp match online

Regex Tester

CyrilEx is an online regex debugger, it allows you to test regular expression in PHP (PCRE), Python, Ruby, JavaScript, Java and MySQL. It helps you to test and debug regex online, you can visualize the matches when matching a string against a regex.

A regex visualizer allows to visualize your regex, it helps to understand it. This feature is useful for large regexes.

Cyrilex also allows you to generate a string example from a RegEx. This gives a pretty quick idea of a regex.

You can consult the regex Quick Start or see the full user guide to help you to use this regular expression tester.

User guide

  • Step 0: Choose the regex engine: JavaScript, Ruby, Java or PCRE (PHP, Python).
  • Step 1: Copy and paste or directly type your regular expression to test in the «Regular expression to test» field.
  • Step 2: Select the flags you want in «Flags» section.
  • Step 3: Copy and paste or directly type your test string in the «test string» field.
  • As soon as you make a modification (regular expression, flags or test string):
    • Step 4: An explanation is generated about of your regex. It uses regulex, it is a JavaScript Regular Expression Parser & Visualizer (Written in pure JavaScript).
    • Step 5: A message indicates the number of correspondence
    • Your regex is highlighted according to the syntax. It is a beta version, it can be wrong.

    regex tester user guide

    regex tester user guide

    share regex tester

    Generate a string from RegEx (Beta):
    Clicks on «Generate a string from RegEx (Beta)» in order to generate a string that matches with the regex.

    Substitutions are not managed.

    News: You can now test MySQL regex, select the «MySQL 8» engine.

    About regular expression

    A regular expression is a sequence of characters that define a search pattern. This pattern is used by string searching algorithms for find or replace text. It can be useful to validate an EMAIL address or an IP address.

    Regex support is part of the standard library of many programming languages. Each programming language has its own regex engine, regular expression implementations vary slightly between languages.

    Regex humor (Jamie Zawinski):
    Some people, when confronted with a problem, think «I know, I’ll use regular expressions.» Now they have two problems.

    Regex Online

    Cyrilex is an online regex checker, it allows to easily test and debug regex. This avoids wasting time writing the few lines of code needed to do the tests.

    A regex visualizer and a regex generator help you to understand and debug your regexes.

    This tool also allows you to share your regular expressions, this can be useful when you want to explain one of your regex problems (or its resolution) on a forum.

    Regex Generator

    Cyrilex also allows generating string from your Regex. By generating a string, this can help understand the Regex. This is particularly useful for fairly long regex.

    This is also useful in the opposite direction. You can validate that your regex is correct by validating that the thong generated corresponds to the expected.

    This tool does not manage all the features of the Regex.

    The unavoidables

    Some regex that can be useful (without warranty).

    The last RFC is complex, there is no reliable solution, this regex should work more than 99% of the time (You must turn off case sensitivity).

    The regex below allows to validate alphanumeric string. Be careful, \w authorizes the underscore character.

    The regex below allows to validate MD5 string.

    The regex below allows to validate IP v4.

    Источник

    Want to support RegExr? Consider disabling your ad-blocker for this domain. We’ll show a non-intrusive, dev-oriented ad in this area.

    Expression

    Create new tests with the ‘Add Test’ button. Click a test to edit the name, type, & text.

    Tools

    RegEx Engine

    Expression Flags

    Sign In

    Sign in to persist favorites & patterns. Click the help icon above for info.

    Any unsaved changes will be lost. Saved patterns & favorites will be migrated to your account.

    Sign Out

    You are currently signed in as via .

    Character classes
    . any character except newline
    \w \d \s word, digit, whitespace
    \W \D \S not word, digit, whitespace
    [abc] any of a, b, or c
    [^abc] not a, b, or c
    [a-g] character between a & g
    Anchors
    ^abc$ start / end of the string
    \b \B word, not-word boundary
    Escaped characters
    \. \* \\ escaped special characters
    \t \n \r tab, linefeed, carriage return
    Groups & Lookaround
    (abc) capture group
    \1 backreference to group #1
    (?:abc) non-capturing group
    (?=abc) positive lookahead
    (?!abc) negative lookahead
    Quantifiers & Alternation
    a* a+ a? 0 or more, 1 or more, 0 or 1
    a a exactly five, two or more
    a between one & three
    a+? a? match as few as possible
    ab|cd match ab or cd

    Источник

    Php regexp match online

    You seem to be using an outdated version of your browser which is no longer supported by regexpr.com. It is highly recommended that you upgrade your browser. Sorry for the inconvenience.

Оцените статью