gitignore_parser icon indicating copy to clipboard operation
gitignore_parser copied to clipboard

DeprecationWarning: Flags not at the start of the expression

Open JulienPalard opened this issue 4 years ago • 1 comments

For anchored matches, the ^ is being inserted before the flags:

>>> import gitignore_parser
>>> from pathlib import Path
>>> gitignore_parser.rule_from_pattern("/foo", Path(".").resolve()).match("42")
/home/mdk/clones/gitignore_parser/gitignore_parser.py:143: DeprecationWarning: Flags not at the start of the expression '^(?ms)foo$'
  if re.search(self.regex, rel_path):
False

JulienPalard avatar Feb 11 '21 22:02 JulienPalard

@JulienPalard we shall fix it by ourselves I guess. Wdyt?

excitoon avatar Aug 26 '22 07:08 excitoon