minus-squareblueduck@piefed.socialto196@lemmy.blahaj.zone•rulelinkfedilinkEnglisharrow-up6·8 days agoPCRE supports inline comments: foo(?# match literal foo)\d+ Also verbose mode pattern = re.compile(r""" ^ # start of string [A-Z]{2} # two uppercase letters \d{4} # four digits $ # end of string """, re.VERBOSE) linkfedilink
PCRE supports inline comments:
foo(?# match literal foo)\d+Also verbose mode
pattern = re.compile(r""" ^ # start of string [A-Z]{2} # two uppercase letters \d{4} # four digits $ # end of string """, re.VERBOSE)