Regular Expressions 101

Save & Share

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

/
/
gm

Test String

Code Generator

Generated Code

# coding=utf8 # the above tag defines encoding for this document and is for Python 2.x compatibility import re regex = r"<strong>([0-9]+)<\/str.*?f=\"(.*?)\".*?ff;\">([A-Z].*?)<\/span>.*?R.*?([0-9.,]+).*?([0-9.,]+)" test_str = "<table class=\"plain mceItemTable\" style=\"margin-left: auto; margin-right: auto; width: 680px; height: 456px;\" data-mce-style=\"margin-left: auto; margin-right: auto; width: 680px; height: 456px;\"><tbody><tr><td><strong>ANO</strong></td><td><strong>EMPRESA</strong></td><td><strong>VALOR ACORDADO</strong></td><td><strong>VALORES PAGOS*</strong></td></tr><tr><td><strong>2021</strong></td><td><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a data-mce-style=\"\" style=\"\" target=\"_blank\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/rolls-royce\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/f8f5ad6036204c75afbdb5a8f8c87348\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">Rolls-Royce PLC</span></a></strong></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\">R$&nbsp;<span>93.838.750,25</span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$ 81.183.700,00</span></td></tr><tr><td><div><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong><strong>2021</strong></strong></span></div></td><td><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a data-mce-style=\"\" style=\"\" target=\"_blank\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/statkraft\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/21593664d673436c9156d1d3fdece208\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">Statkraft</span></a></strong></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$&nbsp;<span>18.015.264,97</span></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$&nbsp;<span>R$ 18.019.532,25</span></span></td></tr><tr><td><div><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong>2021</strong></span></div></td><td><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a data-mce-style=\"\" style=\"\" target=\"_blank\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/amec\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/60771138fb7f497099af49a7a5cab1d1\" class=\"internal-link\" data-tippreview-enabled=\"true\" data-tippy=\"\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">Amec Foster Wheeler</span></a></strong></span><div><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a data-mce-style=\"\" style=\"\" target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/noticias/2021/06/cgu-e-agu-celebram-acordo-de-leniencia-com-as-empresas-sicpa-e-ceptis-no-valor-de-r-762-milhoes\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/b22cdafc066a454fbf2d97ff4f68d71c\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"></span></a></strong></span></div></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$ 86.196.063,32</span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$ 86.196.063,32</span></td></tr><tr><td><div><strong>2021</strong></div></td><td><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a data-mce-style=\"\" style=\"\" target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/samsung\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/974d6f5321ab40009a1abdb81a971177\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"></span></a></strong></span></span><div><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a data-mce-style=\"\" style=\"\" target=\"_blank\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/SICPA-CEPTIS\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/06c26bb4f5934688a728da69600cd332\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">SICPA e CEPTIS</span></a></strong></span></div><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a data-mce-style=\"\" style=\"\" target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/samsung\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/974d6f5321ab40009a1abdb81a971177\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"></span></a></strong></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$ 762.736.310,10</span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\">R$ 23.353.069,10</td></tr><tr><td><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong><strong>2021</strong></strong></span></td><td><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a data-mce-style=\"\" style=\"\" target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/samsung\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/974d6f5321ab40009a1abdb81a971177\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">Samsung Heavy Industries</span></a></strong></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span><span>R$&nbsp;</span>811.786.743,49</span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\">R$ 811.786.743,49&nbsp;</td></tr><tr><td><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong><strong>202</strong>0</strong></span></td><td><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a data-mce-style=\"\" style=\"\" target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/car-rental\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/5cf097ec4d8f4949ac9380dd90e18f5f\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">Car Rental Systems do Brasil</span></a></strong></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\">R$ 762.200,76</td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$ 762.200,76</span></td></tr><tr><td><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong><strong>2019</strong></strong></span></td><td><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/oas\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/5f02b21690a14f75b848d344e3f38a3d\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">OAS</span></a></strong></strong></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$ 1.929.257.982,37</span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\">R$ 2.100.825,83&nbsp;</td></tr><tr><td><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong><strong><strong>2019</strong></strong></strong></span></td><td><strong><a data-mce-style=\"\" target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/sbm-offshore\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/a668e26837e84dc9a62be224fbd7cd02\" class=\"internal-link\" data-tippreview-enabled=\"false\"><strong></strong></a><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/oas\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/5f02b21690a14f75b848d344e3f38a3d\" class=\"internal-link\" data-tippreview-enabled=\"false\"><strong></strong></a><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/nova-participacoes-s-a\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/b11c3cf1206841288a29ce49360e4350\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">Nova Participações S/A</span></a></strong></span></strong></strong></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span><span>R$ 516.301.313,70</span></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$&nbsp;<span>3.131.565,71</span></span></td></tr><tr><td><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong><strong><strong><strong>2019</strong></strong></strong></strong></span></td><td><strong><a data-mce-style=\"\" target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/sbm-offshore\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/a668e26837e84dc9a62be224fbd7cd02\" class=\"internal-link\" data-tippreview-enabled=\"false\"><strong></strong></a><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/oas\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/5f02b21690a14f75b848d344e3f38a3d\" class=\"internal-link\" data-tippreview-enabled=\"false\"><strong></strong></a><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/nova-participacoes-s-a\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/b11c3cf1206841288a29ce49360e4350\" class=\"internal-link\" data-tippreview-enabled=\"false\"><strong></strong></a><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/camargo-correa\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/b82802b96724429ba16fbde2b9a2efa1\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">Camargo Corrêa</span></a></strong></span></strong></strong><strong><strong><strong>**</strong></strong></strong></strong></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span><span><span>R$ 1.396.128.459,76</span></span></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\">R$ 444.571.797,00</td></tr><tr><td><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong><strong><strong><strong><strong><strong>2019</strong></strong></strong></strong></strong></strong></span></td><td><strong><strong><strong><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/camargo-correa\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/b82802b96724429ba16fbde2b9a2efa1\" class=\"internal-link\" data-tippreview-enabled=\"false\"><strong></strong></a><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/technip-brasil-e-flexibras\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/d4ada4f4fda84ca9abc5c680c92a7293\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">Technip Brasil e Flexibras</span></a></strong></span></strong></strong></strong></strong></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span><span><span><span>R$ 819.794.768,79</span></span></span></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$ 849.371.947,71</span></td></tr><tr><td><strong><strong><strong><strong><strong><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong>2019</strong></span><br></strong></span></strong></strong></strong></strong></strong></td><td><strong><strong><strong><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/camargo-correa\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/b82802b96724429ba16fbde2b9a2efa1\" class=\"internal-link\" data-tippreview-enabled=\"false\"><strong></strong></a><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/technip-brasil-e-flexibras\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/d4ada4f4fda84ca9abc5c680c92a7293\" class=\"internal-link\" data-tippreview-enabled=\"false\"><strong></strong></a><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/braskem-s-a\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/cea3f9e1faa94ea9a5dcb702c7677060\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">Braskem S/A</span></a></strong></span></strong></strong></strong></strong><strong><strong><strong>**</strong></strong></strong></strong></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span><span><span><span><span>R$ 2.872.038.787,73</span></span></span></span></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$ 1.842.869.672,81</span></td></tr><tr><td><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong><strong><strong><strong><strong><strong><strong>2018</strong></strong></strong></strong></strong></strong></strong></span></td><td><strong><strong><strong><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/camargo-correa\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/b82802b96724429ba16fbde2b9a2efa1\" class=\"internal-link\" data-tippreview-enabled=\"false\"><strong></strong></a><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/technip-brasil-e-flexibras\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/d4ada4f4fda84ca9abc5c680c92a7293\" class=\"internal-link\" data-tippreview-enabled=\"false\"><strong></strong></a><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/braskem-s-a\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/cea3f9e1faa94ea9a5dcb702c7677060\" class=\"internal-link\" data-tippreview-enabled=\"false\"><strong></strong></a><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/andrade-gutierrez\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/108a584b931041aeac3d8db2ab71bc27\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">Andrade Gutierrez</span></a></strong></span></strong></strong></strong></strong></strong><strong><strong><strong>**</strong></strong></strong></strong></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span><span><span><span><span><span>R$ 1.489.361.135,28</span></span></span></span></span></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$ 399.991.783,47</span>&nbsp;</td></tr><tr><td><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong>2018</strong></span></td><td><strong><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><a data-mce-style=\"\" style=\"\" target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/sbm-offshore\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/a668e26837e84dc9a62be224fbd7cd02\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">SBM Offshore</span></a></span>***</strong></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\">R$ 1.286.038.200,00</td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\">R$ 751.096.652,29</td></tr><tr><td><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong><strong>2018</strong></strong></span></td><td><strong><strong><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/odebrecht\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/4c7854b4736147a49447601c1f37b21d\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">Odebrecht</span></a></span>**</strong></strong></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$ 2.727.239.997,64</span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$&nbsp;</span>151.237.108,51</td></tr><tr><td><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong><strong>2018</strong></strong></span></td><td><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><strong><a target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/mullenlowe-e-fcb-brasil\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/f3b921c841784efe8e98ed9daab41c77\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">Mullenlowe e FCB Brasil</span></a></strong></strong></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$ 50.000.000,00</span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><span>R$ 53.985.613,81</span></td></tr><tr><td><span style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong>2017</strong></span></td><td><strong><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><a data-mce-style=\"\" style=\"\" target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/bilfinger\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/d9666d708f0a49ce861b12da2b77d554\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">Bilfinger</span></a></span>****</strong></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\">R$ 11.036.345,49</td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\">R$ 11.036.345,49</td></tr><tr><td><span class=\"underline\" style=\"color: rgb(0, 0, 0);\" data-mce-style=\"color: #000000;\"><strong>2017</strong></span></td><td><span class=\"underline\" style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\"><strong><a data-mce-style=\"\" style=\"\" target=\"_self\" title=\"\" data-tippreview-image=\"\" href=\"https://www.gov.br/cgu/pt-br/assuntos/responsabilizacao-de-empresas/lei-anticorrupcao/acordo-leniencia/utc-participacoes-s-a\" data-tippreview-title=\"\" data-mce-href=\"resolveuid/0490cbedba1e461c8e25c132cd949299\" class=\"internal-link\" data-tippreview-enabled=\"false\"><span style=\"color: rgb(0, 0, 255);\" data-mce-style=\"color: #0000ff;\">UTC Participações S/A</span></a></strong></span></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\">R$ 574.658.165,21</td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\">R$ 36.600.038,93</td></tr><tr><td><strong></strong></td><td><strong>TOTAL</strong></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><strong>R$&nbsp;</strong><b>15.445.190.488,86</b></td><td style=\"text-align: right;\" data-mce-style=\"text-align: right;\"><strong><span>&nbsp;R$&nbsp;</span></strong><b>5.567.294.660,47</b></td></tr></tbody></table>" matches = re.finditer(regex, test_str, re.MULTILINE) for matchNum, match in enumerate(matches, start=1): print ("Match {matchNum} was found at {start}-{end}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group())) for groupNum in range(0, len(match.groups())): groupNum = groupNum + 1 print ("Group {groupNum} found at {start}-{end}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum))) # Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.

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