And my issue is that sed is not capturing the regex part although it is correct. So if you want to avoid matching a token if a certain token precedes it you may use negative lookbehind. RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp). Groups beginning with (? :very) cold outside", string2) But it doesn't find anyting for string2. It can be used with multiple captured parts. Using regular expressions on Windows hasn’t been particularly easy, as the standard command-line tools have provided very little support to these powerful beasts. In this tutorial, you'll learn how to perform more complex string pattern matching using regular expressions, or regexes, in Python. No atomic grouping or possessive quantifiers. These patterns are used with the exec() and test() methods of RegExp, and with the match(), matchAll(), replace(), replaceAll(), search(), and split() methods of String. For example / (?