Given the following code
Since you confirm my first suggestion (
^(?![ \t]*#)[ \t]*print) worked for you (I deleted that first comment), I believe you just want to find the
\s matches any whitespace, incl. newline symbols. If you need to just match tabs or spaces, use a
[ \t] character class.
or (a bit safer in order not to find any