Maniphest T69480

Batch Rename: Regex group support
Closed, ResolvedTO DO

Assigned To
Campbell Barton (campbellbarton)
Authored By
Campbell Barton (campbellbarton)
Sep 4 2019, 10:09 AM
Tags
  • Pipeline, Assets & I/O
Subscribers
Campbell Barton (campbellbarton)
Jun Mizutani (jmztn)
Viktor (scorg)
Tokens
"Love" token, awarded by jmztn."Like" token, awarded by momotron2000."Love" token, awarded by scorg.

Description

Motivation:

Allow for more flexible string manipulation.

Description:

Current regex only supports matching inputs, so you can for example replace:

[A-Z][A-Za-z0-9_]* > SomeText.

However supporting groups would be useful, eg:

([A-Za-z0-9]+)_([A-Za-z0-9]+) > \2_\1.

Would rename Foo_Bar to Bar_Foo.

We would likely have a second regular expression option for the "Replace" field, so the current basic matching would still be possible.

Related Objects

Mentioned In
T63728: Data, Assets & I/O Module
Mentioned Here
rBd83f62e185b8: WM: batch rename support for regex groups

Event Timeline

Campbell Barton (campbellbarton) lowered the priority of this task from 90 to Low.Sep 4 2019, 10:09 AM
Campbell Barton (campbellbarton) created this task.
Campbell Barton (campbellbarton) mentioned this in T63728: Data, Assets & I/O Module.
Campbell Barton (campbellbarton) updated the task description.Sep 4 2019, 10:17 AM
Viktor (scorg) awarded a token.Sep 4 2019, 11:11 AM
momotron2000 (momotron2000) awarded a token.Sep 4 2019, 11:43 AM
Jun Mizutani (jmztn) awarded a token.Sep 4 2019, 5:57 PM
Jun Mizutani (jmztn) added a subscriber: Jun Mizutani (jmztn).Sep 4 2019, 6:08 PM
Viktor (scorg) added a subscriber: Viktor (scorg).Sep 5 2019, 5:09 PM
Jun Mizutani (jmztn) added a comment.Sep 6 2019, 11:13 AM

This patch enables to replace text using groups.


Campbell Barton (campbellbarton) changed the task status from Unknown Status to Resolved.Sep 6 2019, 3:47 PM
Campbell Barton (campbellbarton) claimed this task.

@Jun Mizutani (jmztn) thanks, committed w/ error handling rBd83f62e185b8e132203654111538229aff1504ac