Regular Expressions 101

Save & Share

  • Regex Version: ver. 1
  • 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

/
/
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"<\d+><(STEAM_\d:\d:\d+)><.*?>" test_str = ("L 04/16/2022 - 18:18:58: Team \"CT\" scored \"1\" with \"2\" players\n" "L 04/16/2022 - 18:18:58: Team \"TERRORIST\" scored \"0\" with \"3\" players\n" "L 04/16/2022 - 18:18:58: MatchStatus: Team \"CT\" is unset.\n" "L 04/16/2022 - 18:18:58: MatchStatus: Team \"TERRORIST\" is unset.\n" "L 04/16/2022 - 18:18:58: MatchStatus: Score: 1:0 on map \"de_dust2\" RoundsPlayed: 1\n" "L 04/16/2022 - 18:18:58: World triggered \"Round_End\"\n" "L 04/16/2022 - 18:18:58: \"Wyatt<10><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 18:19:08: Starting Freeze period\n" "L 04/16/2022 - 18:19:08: \"Bill<7><BOT><TERRORIST>\" triggered \"Got_The_Bomb\"\n" "L 04/16/2022 - 18:19:08: MatchStatus: Team \"CT\" is unset.\n" "L 04/16/2022 - 18:19:08: MatchStatus: Team \"TERRORIST\" is unset.\n" "L 04/16/2022 - 18:19:08: MatchStatus: Score: 1:0 on map \"de_dust2\" RoundsPlayed: 1\n" "L 04/16/2022 - 18:19:13: World triggered \"Round_Start\"\n" "L 04/16/2022 - 18:19:28: \"Bill<7><BOT><TERRORIST>\" triggered \"Dropped_The_Bomb\"\n" "L 04/16/2022 - 18:29:58: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" left buyzone with [ weapon_knife defuser kevlar(100) helmet ]\n" "L 04/16/2022 - 18:30:11: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [362 -391 5] attacked \"Wyatt<10><BOT><TERRORIST>\" [-697 -807 117] with \"hkp2000\" (damage \"17\") (damage_armor \"8\") (health \"83\") (armor \"91\") (hitgroup \"stomach\")\n" "L 04/16/2022 - 18:30:11: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [362 -391 5] attacked \"Bill<7><BOT><TERRORIST>\" [-761 -836 117] with \"hkp2000\" (damage \"5\") (damage_armor \"2\") (health \"95\") (armor \"97\") (hitgroup \"stomach\")\n" "L 04/16/2022 - 18:30:12: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [362 -391 5] attacked \"Wyatt<10><BOT><TERRORIST>\" [-697 -807 117] with \"hkp2000\" (damage \"17\") (damage_armor \"8\") (health \"66\") (armor \"82\") (hitgroup \"stomach\")\n" "L 04/16/2022 - 18:30:12: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [362 -391 5] attacked \"Bill<7><BOT><TERRORIST>\" [-761 -836 117] with \"hkp2000\" (damage \"4\") (damage_armor \"2\") (health \"91\") (armor \"94\") (hitgroup \"chest\")\n" "L 04/16/2022 - 18:30:13: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [362 -391 5] attacked \"Wyatt<10><BOT><TERRORIST>\" [-697 -807 117] with \"hkp2000\" (damage \"14\") (damage_armor \"7\") (health \"52\") (armor \"74\") (hitgroup \"chest\")\n" "L 04/16/2022 - 18:30:13: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [362 -391 5] attacked \"Bill<7><BOT><TERRORIST>\" [-761 -836 117] with \"hkp2000\" (damage \"4\") (damage_armor \"2\") (health \"87\") (armor \"91\") (hitgroup \"chest\")\n" "L 04/16/2022 - 18:30:16: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-98 -700 29] attacked \"Wyatt<10><BOT><TERRORIST>\" [-697 -807 117] with \"hkp2000\" (damage \"63\") (damage_armor \"30\") (health \"0\") (armor \"43\") (hitgroup \"head\")\n" "L 04/16/2022 - 18:30:16: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-98 -700 29] killed \"Wyatt<10><BOT><TERRORIST>\" [-697 -807 181] with \"usp_silencer\" (headshot)\n" "L 04/16/2022 - 18:30:16: \"Wyatt<10><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 18:30:25: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-555 -763 118] attacked \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-555 -763 118] with \"hkp2000\" (damage \"50\") (damage_armor \"0\") (health \"50\") (armor \"100\") (hitgroup \"generic\")\n" "L 04/16/2022 - 18:30:38: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-604 -826 115] attacked \"Bill<7><BOT><TERRORIST>\" [-761 -836 117] with \"hkp2000\" (damage \"68\") (damage_armor \"33\") (health \"19\") (armor \"57\") (hitgroup \"head\")\n" "L 04/16/2022 - 18:30:40: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-604 -826 115] attacked \"Bill<7><BOT><TERRORIST>\" [-761 -836 117] with \"hkp2000\" (damage \"68\") (damage_armor \"33\") (health \"0\") (armor \"23\") (hitgroup \"head\")\n" "L 04/16/2022 - 18:30:40: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-604 -826 115] killed \"Bill<7><BOT><TERRORIST>\" [-761 -836 181] with \"usp_silencer\" (headshot)\n" "L 04/16/2022 - 18:30:40: \"Bill<7><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 18:30:44: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-604 -826 115] attacked \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-604 -826 115] with \"hkp2000\" (damage \"50\") (damage_armor \"0\") (health \"0\") (armor \"100\") (hitgroup \"generic\")\n" "L 04/16/2022 - 18:30:44: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-604 -826 179] committed suicide with \"world\"\n" "L 04/16/2022 - 18:30:44: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" left buyzone with [ ]\n" "L 04/16/2022 - 18:33:33: totalmatches 1\n" "L 04/16/2022 - 18:33:33: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"sad\"\n" "L 04/16/2022 - 18:34:00: totalmatches 1\n" "L 04/16/2022 - 18:38:14: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 18:38:29: totalmatches 1\n" "L 04/16/2022 - 18:38:46: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 18:41:51: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 18:43:15: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 18:43:56: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 18:44:59: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"sd\"\n" "L 04/16/2022 - 18:46:38: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 18:46:59: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 18:47:34: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asda\"\n" "L 04/16/2022 - 18:48:47: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 18:48:51: \"Mike<8><BOT><CT>\" left buyzone with [ ]\n" "L 04/16/2022 - 18:48:55: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" left buyzone with [ weapon_knife weapon_hkp2000 defuser kevlar(100) helmet ]\n" "L 04/16/2022 - 18:49:09: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-223 -725 59] attacked \"Duffy<9><BOT><TERRORIST>\" [-1015 -808 116] with \"hkp2000\" (damage \"15\") (damage_armor \"7\") (health \"85\") (armor \"92\") (hitgroup \"chest\")\n" "L 04/16/2022 - 18:49:14: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-896 -791 117] attacked \"Duffy<9><BOT><TERRORIST>\" [-1015 -808 116] with \"hkp2000\" (damage \"69\") (damage_armor \"33\") (health \"16\") (armor \"58\") (hitgroup \"head\")\n" "L 04/16/2022 - 18:49:14: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-896 -791 117] attacked \"Duffy<9><BOT><TERRORIST>\" [-1015 -808 116] with \"hkp2000\" (damage \"69\") (damage_armor \"33\") (health \"0\") (armor \"24\") (hitgroup \"head\")\n" "L 04/16/2022 - 18:49:14: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-896 -791 117] killed \"Duffy<9><BOT><TERRORIST>\" [-1015 -808 180] with \"hkp2000\" (headshot)\n" "L 04/16/2022 - 18:49:14: Team \"CT\" triggered \"SFUI_Notice_CTs_Win\" (CT \"2\") (T \"0\")\n" "L 04/16/2022 - 18:49:14: Team \"CT\" scored \"2\" with \"2\" players\n" "L 04/16/2022 - 18:49:14: Team \"TERRORIST\" scored \"0\" with \"3\" players\n" "L 04/16/2022 - 18:49:14: MatchStatus: Team \"CT\" is unset.\n" "L 04/16/2022 - 18:49:14: MatchStatus: Team \"TERRORIST\" is unset.\n" "L 04/16/2022 - 18:49:14: MatchStatus: Score: 2:0 on map \"de_dust2\" RoundsPlayed: 2\n" "L 04/16/2022 - 18:49:14: World triggered \"Round_End\"\n" "L 04/16/2022 - 18:49:14: \"Duffy<9><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 18:49:24: Starting Freeze period\n" "L 04/16/2022 - 18:49:24: \"Duffy<9><BOT><TERRORIST>\" triggered \"Got_The_Bomb\"\n" "L 04/16/2022 - 18:49:24: MatchStatus: Team \"CT\" is unset.\n" "L 04/16/2022 - 18:49:24: MatchStatus: Team \"TERRORIST\" is unset.\n" "L 04/16/2022 - 18:49:24: MatchStatus: Score: 2:0 on map \"de_dust2\" RoundsPlayed: 2\n" "L 04/16/2022 - 18:49:24: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" left buyzone with [ weapon_knife weapon_usp_silencer defuser kevlar(100) helmet ]\n" "L 04/16/2022 - 18:49:29: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [258 2481 -121] attacked \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [258 2481 -121] with \"hkp2000\" (damage \"5\") (damage_armor \"0\") (health \"95\") (armor \"100\") (hitgroup \"generic\")\n" "L 04/16/2022 - 18:49:29: World triggered \"Round_Start\"\n" "L 04/16/2022 - 18:49:44: \"Duffy<9><BOT><TERRORIST>\" triggered \"Dropped_The_Bomb\"\n" "L 04/16/2022 - 18:49:44: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [258 2481 -121] attacked \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [258 2481 -121] with \"hkp2000\" (damage \"5\") (damage_armor \"0\") (health \"90\") (armor \"100\") (hitgroup \"generic\")\n" "L 04/16/2022 - 18:49:49: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [258 2481 -121] attacked \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [258 2481 -121] with \"hkp2000\" (damage \"5\") (damage_armor \"0\") (health \"85\") (armor \"100\") (hitgroup \"generic\")\n" "L 04/16/2022 - 18:55:07: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 18:55:23: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 18:55:43: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 18:55:55: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [258 2481 -121] attacked \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [258 2481 -121] with \"hkp2000\" (damage \"1\") (damage_armor \"0\") (health \"84\") (armor \"100\") (hitgroup \"generic\")\n" "L 04/16/2022 - 18:56:33: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"sad\"\n" "L 04/16/2022 - 18:56:40: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [258 2481 -121] attacked \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [258 2481 -121] with \"hkp2000\" (damage \"1\") (damage_armor \"0\") (health \"83\") (armor \"100\") (hitgroup \"generic\")\n" "L 04/16/2022 - 18:57:11: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 18:57:17: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" left buyzone with [ weapon_knife weapon_usp_silencer defuser kevlar(100) helmet ]\n" "L 04/16/2022 - 18:57:37: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Duffy<9><BOT><TERRORIST>\" [-428 -843 95] with \"hkp2000\" (damage \"24\") (damage_armor \"0\") (health \"76\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 18:58:14: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Duffy<9><BOT><TERRORIST>\" [-428 -843 95] with \"hkp2000\" (damage \"24\") (damage_armor \"0\") (health \"52\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 18:59:12: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Duffy<9><BOT><TERRORIST>\" [-428 -843 95] with \"hkp2000\" (damage \"24\") (damage_armor \"0\") (health \"28\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 18:59:30: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Duffy<9><BOT><TERRORIST>\" [-428 -843 95] with \"hkp2000\" (damage \"24\") (damage_armor \"0\") (health \"4\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:00:07: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Duffy<9><BOT><TERRORIST>\" [-428 -843 95] with \"hkp2000\" (damage \"24\") (damage_armor \"0\") (health \"0\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:00:07: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] killed \"Duffy<9><BOT><TERRORIST>\" [-428 -843 159] with \"usp_silencer\"\n" "L 04/16/2022 - 19:00:07: \"Duffy<9><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 19:01:25: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Bill<7><BOT><TERRORIST>\" [-533 -754 117] with \"hkp2000\" (damage \"23\") (damage_armor \"0\") (health \"77\") (armor \"100\") (hitgroup \"right leg\")\n" "L 04/16/2022 - 19:01:41: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Bill<7><BOT><TERRORIST>\" [-533 -754 117] with \"hkp2000\" (damage \"23\") (damage_armor \"0\") (health \"54\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:01:55: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Bill<7><BOT><TERRORIST>\" [-533 -754 117] with \"hkp2000\" (damage \"23\") (damage_armor \"0\") (health \"31\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:02:16: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Bill<7><BOT><TERRORIST>\" [-533 -754 117] with \"hkp2000\" (damage \"23\") (damage_armor \"0\") (health \"8\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:02:18: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Bill<7><BOT><TERRORIST>\" [-533 -754 117] with \"hkp2000\" (damage \"23\") (damage_armor \"0\") (health \"0\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:02:18: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] killed \"Bill<7><BOT><TERRORIST>\" [-533 -754 181] with \"usp_silencer\"\n" "L 04/16/2022 - 19:02:18: \"Bill<7><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 19:03:22: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Wyatt<10><BOT><TERRORIST>\" [-980 -754 120] with \"hkp2000\" (damage \"18\") (damage_armor \"8\") (health \"82\") (armor \"91\") (hitgroup \"stomach\")\n" "L 04/16/2022 - 19:03:38: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Wyatt<10><BOT><TERRORIST>\" [-980 -754 120] with \"hkp2000\" (damage \"18\") (damage_armor \"8\") (health \"64\") (armor \"82\") (hitgroup \"stomach\")\n" "L 04/16/2022 - 19:04:02: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Wyatt<10><BOT><TERRORIST>\" [-980 -754 120] with \"hkp2000\" (damage \"18\") (damage_armor \"9\") (health \"46\") (armor \"72\") (hitgroup \"stomach\")\n" "L 04/16/2022 - 19:04:22: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Wyatt<10><BOT><TERRORIST>\" [-980 -754 120] with \"hkp2000\" (damage \"18\") (damage_armor \"8\") (health \"28\") (armor \"63\") (hitgroup \"stomach\")\n" "L 04/16/2022 - 19:05:08: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Wyatt<10><BOT><TERRORIST>\" [-980 -754 120] with \"hkp2000\" (damage \"21\") (damage_armor \"0\") (health \"7\") (armor \"63\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:05:29: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] attacked \"Wyatt<10><BOT><TERRORIST>\" [-980 -754 120] with \"hkp2000\" (damage \"21\") (damage_armor \"0\") (health \"0\") (armor \"63\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:05:29: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [9 -628 64] killed \"Wyatt<10><BOT><TERRORIST>\" [-980 -754 184] with \"usp_silencer\"\n" "L 04/16/2022 - 19:05:29: Team \"CT\" triggered \"SFUI_Notice_CTs_Win\" (CT \"3\") (T \"0\")\n" "L 04/16/2022 - 19:05:29: Team \"CT\" scored \"3\" with \"2\" players\n" "L 04/16/2022 - 19:05:29: Team \"TERRORIST\" scored \"0\" with \"3\" players\n" "L 04/16/2022 - 19:05:29: MatchStatus: Team \"CT\" is unset.\n" "L 04/16/2022 - 19:05:29: MatchStatus: Team \"TERRORIST\" is unset.\n" "L 04/16/2022 - 19:05:29: MatchStatus: Score: 3:0 on map \"de_dust2\" RoundsPlayed: 3\n" "L 04/16/2022 - 19:05:29: World triggered \"Round_End\"\n" "L 04/16/2022 - 19:05:29: \"Wyatt<10><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 19:05:39: Starting Freeze period\n" "L 04/16/2022 - 19:05:39: \"Wyatt<10><BOT><TERRORIST>\" triggered \"Got_The_Bomb\"\n" "L 04/16/2022 - 19:05:39: MatchStatus: Team \"CT\" is unset.\n" "L 04/16/2022 - 19:05:39: MatchStatus: Team \"TERRORIST\" is unset.\n" "L 04/16/2022 - 19:05:39: MatchStatus: Score: 3:0 on map \"de_dust2\" RoundsPlayed: 3\n" "L 04/16/2022 - 19:05:44: World triggered \"Round_Start\"\n" "L 04/16/2022 - 19:05:46: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" left buyzone with [ weapon_knife weapon_usp_silencer defuser kevlar(100) helmet ]\n" "L 04/16/2022 - 19:05:59: \"Wyatt<10><BOT><TERRORIST>\" triggered \"Dropped_The_Bomb\"\n" "L 04/16/2022 - 19:06:04: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-276 -663 74] attacked \"Duffy<9><BOT><TERRORIST>\" [-332 -754 79] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"75\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:09:44: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-276 -663 74] attacked \"Duffy<9><BOT><TERRORIST>\" [-332 -754 79] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"50\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:10:17: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-276 -663 74] attacked \"Duffy<9><BOT><TERRORIST>\" [-332 -754 79] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"25\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:11:16: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-276 -663 74] attacked \"Duffy<9><BOT><TERRORIST>\" [-332 -754 79] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"0\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:11:16: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-276 -663 74] killed \"Duffy<9><BOT><TERRORIST>\" [-332 -754 143] with \"usp_silencer\"\n" "L 04/16/2022 - 19:11:16: \"Duffy<9><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 19:12:32: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-276 -663 74] attacked \"Bill<7><BOT><TERRORIST>\" [-367 -808 84] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"75\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:12:59: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-276 -663 74] attacked \"Bill<7><BOT><TERRORIST>\" [-367 -808 84] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"50\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:13:17: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-276 -663 74] attacked \"Bill<7><BOT><TERRORIST>\" [-367 -808 84] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"25\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:13:39: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-276 -663 74] attacked \"Bill<7><BOT><TERRORIST>\" [-367 -808 84] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"0\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:13:39: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-276 -663 74] killed \"Bill<7><BOT><TERRORIST>\" [-367 -808 148] with \"usp_silencer\"\n" "L 04/16/2022 - 19:13:39: \"Bill<7><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 19:14:35: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-657 -694 129] attacked \"Wyatt<10><BOT><TERRORIST>\" [-761 -836 117] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"75\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:15:38: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-657 -694 129] attacked \"Wyatt<10><BOT><TERRORIST>\" [-761 -836 117] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"50\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:15:56: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-657 -694 129] attacked \"Wyatt<10><BOT><TERRORIST>\" [-761 -836 117] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"25\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:16:56: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-657 -694 129] attacked \"Wyatt<10><BOT><TERRORIST>\" [-761 -836 117] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"0\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:16:56: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-657 -694 129] killed \"Wyatt<10><BOT><TERRORIST>\" [-761 -836 181] with \"usp_silencer\"\n" "L 04/16/2022 - 19:16:56: Team \"CT\" triggered \"SFUI_Notice_CTs_Win\" (CT \"4\") (T \"0\")\n" "L 04/16/2022 - 19:16:56: Team \"CT\" scored \"4\" with \"2\" players\n" "L 04/16/2022 - 19:16:56: Team \"TERRORIST\" scored \"0\" with \"3\" players\n" "L 04/16/2022 - 19:16:56: MatchStatus: Team \"CT\" is unset.\n" "L 04/16/2022 - 19:16:56: MatchStatus: Team \"TERRORIST\" is unset.\n" "L 04/16/2022 - 19:16:56: MatchStatus: Score: 4:0 on map \"de_dust2\" RoundsPlayed: 4\n" "L 04/16/2022 - 19:16:56: World triggered \"Round_End\"\n" "L 04/16/2022 - 19:16:56: \"Wyatt<10><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 19:17:06: Starting Freeze period\n" "L 04/16/2022 - 19:17:06: \"Bill<7><BOT><TERRORIST>\" triggered \"Got_The_Bomb\"\n" "L 04/16/2022 - 19:17:06: MatchStatus: Team \"CT\" is unset.\n" "L 04/16/2022 - 19:17:06: MatchStatus: Team \"TERRORIST\" is unset.\n" "L 04/16/2022 - 19:17:06: MatchStatus: Score: 4:0 on map \"de_dust2\" RoundsPlayed: 4\n" "L 04/16/2022 - 19:17:06: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" left buyzone with [ weapon_knife weapon_usp_silencer defuser kevlar(100) helmet ]\n" "L 04/16/2022 - 19:17:11: World triggered \"Round_Start\"\n" "L 04/16/2022 - 19:17:14: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" left buyzone with [ weapon_knife weapon_usp_silencer defuser kevlar(100) helmet ]\n" "L 04/16/2022 - 19:17:26: \"Bill<7><BOT><TERRORIST>\" triggered \"Dropped_The_Bomb\"\n" "L 04/16/2022 - 19:20:04: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-236 -660 64] attacked \"Duffy<9><BOT><TERRORIST>\" [-332 -754 79] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"75\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:20:18: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-236 -660 64] attacked \"Duffy<9><BOT><TERRORIST>\" [-332 -754 79] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"50\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:21:13: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-236 -660 64] attacked \"Duffy<9><BOT><TERRORIST>\" [-332 -754 79] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"25\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:21:47: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-236 -660 64] attacked \"Duffy<9><BOT><TERRORIST>\" [-332 -754 79] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"0\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:21:47: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-236 -660 64] killed \"Duffy<9><BOT><TERRORIST>\" [-332 -754 143] with \"usp_silencer\"\n" "L 04/16/2022 - 19:21:47: \"Duffy<9><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 19:22:24: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-538 -666 127] attacked \"Bill<7><BOT><TERRORIST>\" [-657 -756 120] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"75\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:22:53: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-538 -666 127] attacked \"Bill<7><BOT><TERRORIST>\" [-657 -756 120] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"50\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:25:09: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-538 -666 127] attacked \"Bill<7><BOT><TERRORIST>\" [-657 -756 120] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"25\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:26:55: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-538 -666 127] attacked \"Bill<7><BOT><TERRORIST>\" [-657 -756 120] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"0\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:26:55: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-538 -666 127] killed \"Bill<7><BOT><TERRORIST>\" [-657 -756 184] with \"usp_silencer\"\n" "L 04/16/2022 - 19:26:55: \"Bill<7><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 19:27:31: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-833 -698 129] attacked \"Wyatt<10><BOT><TERRORIST>\" [-1015 -808 116] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"75\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:27:41: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-833 -698 129] attacked \"Wyatt<10><BOT><TERRORIST>\" [-1015 -808 116] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"50\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:28:08: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-833 -698 129] attacked \"Wyatt<10><BOT><TERRORIST>\" [-1015 -808 116] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"25\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:28:38: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-833 -698 129] attacked \"Wyatt<10><BOT><TERRORIST>\" [-1015 -808 116] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"0\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:28:38: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [-833 -698 129] killed \"Wyatt<10><BOT><TERRORIST>\" [-1015 -808 180] with \"usp_silencer\"\n" "L 04/16/2022 - 19:28:38: Team \"CT\" triggered \"SFUI_Notice_CTs_Win\" (CT \"5\") (T \"0\")\n" "L 04/16/2022 - 19:28:38: Team \"CT\" scored \"5\" with \"2\" players\n" "L 04/16/2022 - 19:28:38: Team \"TERRORIST\" scored \"0\" with \"3\" players\n" "L 04/16/2022 - 19:28:38: MatchStatus: Team \"CT\" is unset.\n" "L 04/16/2022 - 19:28:38: MatchStatus: Team \"TERRORIST\" is unset.\n" "L 04/16/2022 - 19:28:38: MatchStatus: Score: 5:0 on map \"de_dust2\" RoundsPlayed: 5\n" "L 04/16/2022 - 19:28:38: World triggered \"Round_End\"\n" "L 04/16/2022 - 19:28:38: \"Wyatt<10><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 19:28:48: Starting Freeze period\n" "L 04/16/2022 - 19:28:48: \"Duffy<9><BOT><TERRORIST>\" triggered \"Got_The_Bomb\"\n" "L 04/16/2022 - 19:28:48: MatchStatus: Team \"CT\" is unset.\n" "L 04/16/2022 - 19:28:48: MatchStatus: Team \"TERRORIST\" is unset.\n" "L 04/16/2022 - 19:28:48: MatchStatus: Score: 5:0 on map \"de_dust2\" RoundsPlayed: 5\n" "L 04/16/2022 - 19:28:48: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" left buyzone with [ weapon_knife weapon_usp_silencer defuser kevlar(100) helmet ]\n" "L 04/16/2022 - 19:28:53: World triggered \"Round_Start\"\n" "L 04/16/2022 - 19:29:00: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 19:29:08: \"Duffy<9><BOT><TERRORIST>\" triggered \"Dropped_The_Bomb\"\n" "L 04/16/2022 - 19:30:58: \"Bill<7><BOT><TERRORIST>\" left buyzone with [ weapon_knife_t weapon_glock kevlar(100) helmet ]\n" "L 04/16/2022 - 19:31:01: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [153 2223 -128] attacked \"Bill<7><BOT><TERRORIST>\" [144 2082 -125] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"75\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:32:30: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [153 2223 -128] attacked \"Bill<7><BOT><TERRORIST>\" [144 2082 -125] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"50\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:33:19: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [153 2223 -128] attacked \"Bill<7><BOT><TERRORIST>\" [144 2082 -125] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"25\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:34:45: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [153 2223 -128] attacked \"Bill<7><BOT><TERRORIST>\" [144 2082 -125] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"0\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:34:45: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [153 2223 -128] killed \"Bill<7><BOT><TERRORIST>\" [144 2082 -61] with \"usp_silencer\"\n" "L 04/16/2022 - 19:34:45: \"Bill<7><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 19:35:11: \"Duffy<9><BOT><TERRORIST>\" left buyzone with [ weapon_knife_t weapon_glock kevlar(100) helmet ]\n" "L 04/16/2022 - 19:35:15: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [237 2227 -128] attacked \"Duffy<9><BOT><TERRORIST>\" [236 2122 -127] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"75\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:37:33: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [237 2227 -128] attacked \"Duffy<9><BOT><TERRORIST>\" [236 2122 -127] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"50\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:39:32: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [237 2227 -128] attacked \"Duffy<9><BOT><TERRORIST>\" [236 2122 -127] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"25\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:41:42: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [237 2227 -128] attacked \"Duffy<9><BOT><TERRORIST>\" [236 2122 -127] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"0\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:41:42: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [237 2227 -128] killed \"Duffy<9><BOT><TERRORIST>\" [236 2122 -63] with \"usp_silencer\"\n" "L 04/16/2022 - 19:41:42: \"Duffy<9><BOT><TERRORIST>\" left buyzone with [ ]\n" "L 04/16/2022 - 19:44:40: \"Wyatt<10><BOT><TERRORIST>\" left buyzone with [ weapon_knife_t weapon_glock kevlar(100) helmet ]\n" "L 04/16/2022 - 19:44:43: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [310 2235 -128] attacked \"Wyatt<10><BOT><TERRORIST>\" [288 2148 -127] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"75\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:45:05: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [310 2235 -128] attacked \"Wyatt<10><BOT><TERRORIST>\" [288 2148 -127] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"50\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:47:43: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 19:49:02: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [310 2235 -128] attacked \"Wyatt<10><BOT><TERRORIST>\" [288 2148 -127] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"25\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:49:50: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" say \"asd\"\n" "L 04/16/2022 - 19:55:36: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [310 2235 -128] attacked \"Wyatt<10><BOT><TERRORIST>\" [288 2148 -127] with \"hkp2000\" (damage \"25\") (damage_armor \"0\") (health \"0\") (armor \"100\") (hitgroup \"left leg\")\n" "L 04/16/2022 - 19:55:36: \"'Bacardi<6><STEAM_1:1:14163588><CT>\" [310 2235 -128] killed \"Wyatt<10><BOT><TERRORIST>\" [288 2148 -63] with \"usp_silencer\"\n" "L 04/16/2022 - 19:55:36: Team \"CT\" triggered \"SFUI_Notice_CTs_Win\" (CT \"6\") (T \"0\")\n" "L 04/16/2022 - 19:55:36: Team \"CT\" scored \"6\" with \"2\" players\n" "L 04/16/2022 - 19:55:36: Team \"TERRORIST\" scored \"0\" with \"3\" players\n" "L 04/16/2022 - 19:55:36: MatchStatus: Team \"CT\" is unset.") 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