Regular Expressions 101

Save & Share

  • Regex Version: ver. 11
  • Update Regex
    ctrl+⇧+s
  • Save new Regex
    ctrl+s
  • Add to Community Library

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8
  • .NET 7.0 (C#)
  • Rust
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests

Tools

Sponsors
There are currently no sponsors. Become a sponsor today!
An explanation of your regex will be automatically generated as you type.
Detailed match information will be displayed here automatically.
  • All Tokens
  • Common Tokens
  • General Tokens
  • Anchors
  • Meta Sequences
  • Quantifiers
  • Group Constructs
  • Character Classes
  • Flags/Modifiers
  • Substitution
  • A single character of: a, b or c
    [abc]
  • A character except: a, b or c
    [^abc]
  • A character in the range: a-z
    [a-z]
  • A character not in the range: a-z
    [^a-z]
  • A character in the range: a-z or A-Z
    [a-zA-Z]
  • Any single character
    .
  • Alternate - match either a or b
    a|b
  • Any whitespace character
    \s
  • Any non-whitespace character
    \S
  • Any digit
    \d
  • Any non-digit
    \D
  • Any word character
    \w
  • Any non-word character
    \W
  • Non-capturing group
    (?:...)
  • Capturing group
    (...)
  • Zero or one of a
    a?
  • Zero or more of a
    a*
  • One or more of a
    a+
  • Exactly 3 of a
    a{3}
  • 3 or more of a
    a{3,}
  • Between 3 and 6 of a
    a{3,6}
  • Start of string
    ^
  • End of string
    $
  • A word boundary
    \b
  • Non-word boundary
    \B

Regular Expression

/
/

Test String

Code Generator

Generated Code

$re = '/(?:\S+[,.?!]?\s+){1,200}[\s\S]*?(\. |!|\?)/'; $str = 'Therapy extract straw and chitosan from shrimp shells alone accounted for 2, 4, 6, 8 and 10% found that the extract straw 8% is highly effective in inhibiting the growth of algae Microcystis spp. The number of cells and the amount of chlorophyll a was reduced during treatment. Both value decreased continuous until the end of the trial. On the last day of the experiment, the cell number decreased to 64.21% and the amount of chlorophyll a decreased of 37.39% compared with the control. The extract straw 2, 4, 6 and 10% cells Microcystis spp. was 1182, 4281, 4089 and 18.53% respectively. The amount of chlorophyll a decreased of 1370, 1765, 2802 and 22.66% respectively. (Figure 1-2) If the chitosan from shrimp shells in a proportion of 10% to get rid of cell toxic algae Microcystis spp. was the highest at 79.69% inhibition of chlorophyll a decreased to 47.85% compared to the control in 44 day. The chitosan from shrimp shells 2, 4, 6 and 8% efficiency into the cell numbers decreased 6435, 6176, 7043 and 77.16% respectively and chlorophyll a decreased 1195, 4101, 1861 and. 42.78% respectively. (Figure 3-4) In addition, treatment with the extract of rice straw mixed with chitosan from shrimp shells in the ratio of 3:1, 2:1, 1:1, 1:2 and 1:3 each treatment decreased significantly. continuing from 3 to 44 days of trial. Therapy extract straw and chitosan from shrimp shells alone accounted for 2, 4, 6, 8 and 10% found that the extract straw 8% is highly effective in inhibiting the growth of algae Microcystis spp. The number of cells and the amount of chlorophyll a was reduced during treatment. Both value decreased continuous until the end of the trial. On the last day of the experiment, the cell number decreased to 64.21% and the amount of chlorophyll a decreased of 37.39% compared with the control. The extract straw 2, 4, 6 and 10% cells Microcystis spp. was 1182, 4281, 4089 and 18.53% respectively. The amount of chlorophyll a decreased of 1370, 1765, 2802 and 22.66% respectively. (Figure 1-2) If the chitosan from shrimp shells in a proportion of 10% to get rid of cell toxic algae Microcystis spp. was the highest at 79.69% inhibition of chlorophyll a decreased to 47.85% compared to the control in 44 day. The chitosan from shrimp shells 2, 4, 6 and 8% efficiency into the cell numbers decreased 6435, 6176, 7043 and 77.16% respectively and chlorophyll a decreased 1195, 4101, 1861 and. 42.78% respectively. (Figure 3-4) In addition, treatment with the extract of rice straw mixed with chitosan from shrimp shells in the ratio of 3:1, 2:1, 1:1, 1:2 and 1:3 each treatment decreased significantly. continuing from 3 to 44 days of trial. Therapy extract straw and chitosan from shrimp shells alone accounted for 2, 4, 6, 8 and 10% found that the extract straw 8% is highly effective in inhibiting the growth of algae Microcystis spp. The number of cells and the amount of chlorophyll a was reduced during treatment. Both value decreased continuous until the end of the trial. On the last day of the experiment, the cell number decreased to 64.21% and the amount of chlorophyll a decreased of 37.39% compared with the control. The extract straw 2, 4, 6 and 10% cells Microcystis spp. was 1182, 4281, 4089 and 18.53% respectively. The amount of chlorophyll a decreased of 1370, 1765, 2802 and 22.66% respectively. (Figure 1-2) If the chitosan from shrimp shells in a proportion of 10% to get rid of cell toxic algae Microcystis spp. was the highest at 79.69% inhibition of chlorophyll a decreased to 47.85% compared to the control in 44 day. The chitosan from shrimp shells 2, 4, 6 and 8% efficiency into the cell numbers decreased 6435, 6176, 7043 and 77.16% respectively and chlorophyll a decreased 1195, 4101, 1861 and. 42.78% respectively. (Figure 3-4) In addition, treatment with the extract of rice straw mixed with chitosan from shrimp shells in the ratio of 3:1, 2:1, 1:1, 1:2 and 1:3 each treatment decreased significantly. continuing from 3 to 44 days of trial. The best extract of rice straw on chitosan from shrimp shells of the laboratory effective deterrent Microcystis spp. was mixed with Microcystis spp. from natural sources in a final volume of 500 L in 1 m cement diameter. The experiment was repeated 3 time. The controllers were not added straw extract and chitosan from shrimp shells. It were filled a Microcystis spp. from natural sources only. The best extract of rice straw on chitosan from shrimp shells of the laboratory effective deterrent Microcystis spp. was mixed with Microcystis spp. from natural sources in a final volume of 500 L in 1 m cement diameter. The experiment was repeated 3 time. The controllers were not added straw extract and chitosan from shrimp shells. It were filled a Microcystis spp. from natural sources only. The best extract of rice straw on chitosan from shrimp shells of the laboratory effective deterrent Microcystis spp. was mixed with Microcystis spp. from natural sources in a final volume of 500 L in 1 m cement diameter. The experiment was repeated 3 time. The controllers were not added straw extract and chitosan from shrimp shells. It were filled a Microcystis spp. from natural sources only."'; preg_match($re, $str, $matches, PREG_OFFSET_CAPTURE, 0); // Print the entire match result var_dump($matches);

Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php