eye.reutils module

Regular expression utilities

eye.reutils.csToQtEnum(cs)[source]

Return a Qt.CaseSensitivity flag for bool cs

eye.reutils.glob2re(globstr, can_escape=False, dotslash=2, exact=False, double_star=False, sets=False)[source]

Convert a globbing pattern to a Python regex pattern

Parameters:
  • globstr – the glob pattern to convert

  • exact – if True, the pattern will match the start and end of string (^ and $ are added)

  • double_star – if True, “**” is interpreted to match a indefinite number of path components

  • sets – if True, “{foo,bar}” will match “foo” or “bar”

  • can_escape – if True, backslashes can be used to escape other metacharacters, else it will be literal

eye.reutils.qreToPattern(qre)[source]
eye.reutils.qtEnumToCs(enum)[source]

Return True if enum value equals Qt.CaseSensitive