Support multiple patterns #1

Closed
opened 2021-12-20 20:57:17 -08:00 by KayFaraday · 0 comments
Owner

We can do many fixed strings by generating a regex pattern out of the individual fixed strings:

(pattern1|pattern2|pattern3)

then, we can make a dict that maps patterns to replacements, and look up that dict for each match, by passing replacements_dict.get as the replacement argument to re.replace.

We can do many fixed strings by generating a regex pattern out of the individual fixed strings: ```regex (pattern1|pattern2|pattern3) ``` then, we can make a dict that maps patterns to replacements, and look up that dict for each match, by passing `replacements_dict.get` as the `replacement` argument to re.replace.
KayFaraday added the
enhancement
label 2021-12-20 20:57:17 -08:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: FreakU/replacer#1
No description provided.