Regular Expressions 101

Community Patterns

Want to exclude all lines with a COLON : otherwise find what is after array.

0

Regular Expression
Python

r"""
^[^:]*((array|unassigned)*)[^:]*\n$
"""
ig

Description

Find all lines with the word array OR unassigned except for lines with a ':' COLON character.

Thanks to Kinny on IRC :)

Added some tests.

Submitted by Kinny, rjt - 5 years ago