bookmark

Multi-regex: single pass replace of multiple regexes (Python recipe)


Description

All regexes first get combined into a single big disjunction. Then, for each match, the matching sub-regex is determined from a group name and the match object dispatched to a corresponding method, or simply replaced by a string.

Preview

Tags

Users

  • @victoria_helen

Comments and Reviews