Regular Expressions 101

Save & Manage Regex

  • Current Version: 1
  • Save & Share
  • Community Library

Flavor

  • PCRE2 (PHP)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java
  • .NET 7.0 (C#)
  • Rust
  • PCRE (Legacy)
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests
Sponsors
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
Processing...

Test String

Code Generator

Generated Code

import re regex = re.compile(r"\b\d+\.[^\S\n][^.!?]*(?:[.!?](?=\S)[^.!?]*)*[.!?]", flags=re.MULTILINE) test_str = ("\" \n" " IN THE CIRCUIT COURT, OF THE \n" "EIGHTEENTH JUDICIAL CIRCUIT, IN \n" "AND FOR SEMINOLE COUNTY, \n" "FLORIDA \n" " \n" "CASE NO: 2022 -CA-002235 \n" " \n" "JOSHUA PINK, \n" " \n" " Plaintiff, \n" "vs. \n" " \n" "MATHEW ZUMBRUM , \n" " \n" " Defendant. \n" " / \n" " \n" "DEFENDANT'S REQUEST FOR ADMISSIONS TO PLAINTIFF, JOSHUA PINK \n" " \n" " \n" "COME NOW the Defendant , MATHEW ZUMBRUM , by and through the undersigned \n" "attorneys, and pursuant to Rule 1.370, Florida Rul es of Civil Procedure, requests the Plaintiff, \n" "JOSHUA PINK, admit in this action that each of the following statements are true: \n" "1. Please admit that Plaintiff, JOSHUA PINK , received benefits from a collateral \n" "source, as defined by §768.76, Florida Statute s, for medical bills alleged to have been incurred as \n" "a result of the incident described in the Complaint. \n" "2. Please admit that Plaintiff, JOSHUA PINK , received benefits from a collateral \n" "source, as defined by §768.76, Florida Statutes, for loss of wages o r income alleged to have been \n" "sustained as a result of the incident described in the Complaint. \n" "3. Please admit that Plaintiff, JOSHUA PINK , received benefits under the Personal \n" "Injury Protection portion of an automobile policy for medical bills alleged to have been incurred \n" "as a result of the incident described in the Complaint. \n" " Filing # 162442429 E-Filed 12/06/2022 09:46:49 AM\n" " \n" "2 4. Please admit that Plaintiff, JOSHUA PINK , received benefits under the Personal \n" "Injury Protection portion of an automobile insurance policy for loss of wages or income alleged \n" "to have been sustained as a result of the incident described in the Complaint. \n" "5. Please admit that Plaintiff, JOSHUA PINK , received benefits under the medical \n" "payments provisions of an automobile insurance policy for medical bills alleged to have been \n" "incurred as a result of the incident described in the Complaint. \n" "6. Please admit that Plaintiff, JOSHUA PINK , is subject to a deductible under the \n" "Personal Injury Protection portion of an automobile insurance policy. \n" "7. Please admit that Plaintiff, JOSHUA PINK received benefits pursuant to personal \n" "or group health insurance policy, for medical bills alleged to have been incurred as a result of the \n" "incident described in the Complaint. \n" "8. Please admit that Plaintiff, JOSHUA PINK , received benefits pursuant to a \n" "personal or group wage continuation plan or policy, for loss of wages or income alleged to have \n" "been sustained as a result of the incident described in the Complaint. \n" " 9. Please admit that on the date of the accident alleged in your Complaint, Defendant, \n" "MATHEW ZUMBRUM , complied with and met the security requirements under Chapter \n" "627.730 - 627.7405, Florida Statutes. \n" "10. Please admit that Plaintiff, JOSHUA PINK , was partially responsible for the \n" "subject accident. \n" "11. Please admit that Plaintiff, JOSHUA PINK , did NOT suffer a permanent injury as \n" "a result of the subject accident. \n" "I HEREBY CERTIFY that on the 6th day of December, 2022 a true and correct copy of \n" "the foregoing was electronically filed with the Florida Court s E-Filing Portal system which will \n" " \n" "3 send a notice of electronic filing to Michael R. Vaughn, Esq., Morgan & Morgan, P.A., 20 N. \n" "Orange Ave, 16th Floor, Orlando, FL 32801 at mvaughn@forthepeople.com; \n" "jburnham@forthepeople.com; mserrano@forthepeople.com. \n" "AND REW J. GORMAN & ASSOCIATES \n" " \n" "BY: \n" " \n" "(Original signed electronically by Attorney.) \n" "LOURDES CALVO -PAQUETTE, ESQ. \n" "Attorney for Defendant, Zumbrum \n" "390 N. Orange Avenue, Suite 1700 \n" "Orlando, FL 32801 \n" "Telephone: (407) 872 -2498 \n" "Facsímile: (855) 369 -8989 \n" "Florida Bar No. 0817295 \n" "E-mail for service (FL R. Jud. Admin. 2.516) : \n" "flor.law -mlslaw.172o19@statefarm.com \n" " \n" "Attorneys and Staff of Andrew J. Gorman & \n" "Associates are Employees of the Law Department \n" "of State Farm Mutual Automobile Insurance \n" "Company. \n" " \n" " \n\n" "\"\n") matches = regex.finditer(test_str) for match_num, match in enumerate(matches, start=1): print(f"Match {match_num} was found at {match.start()}-{match.end()}: {match.group()}") for group_num, group in enumerate(match.groups(), start=1): print(f"Group {group_num} found at {match.start(group_num)}-{match.end(group_num)}: {group}")

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 Python, please visit: https://docs.python.org/3/library/re.html