Page MenuHomePhabricator

Add gsub
Open, Needs TriagePublicFeature

Description

Feature summary
Add functionality for gsub replacement. str_replace is currently available but does not support regexes.

Use case(s)

  • T27619 is stuck, but currently (on enwiki) we just add the extra variables to the filter manually, but they (or a variable containing them) needs to be copied in the filter regex for every occurrence of that letter. The expression would be more readable if we could just gsub the added_lines.

Example

Currently:

/* Reusable letters, for when ccnorm isn't enough */
o := "ÒÔ";

exp1 := "p[" + o + "]int";

After a gsub is available:

/* Reusable letters, for when ccnorm isn't enough */
new_added_lines := gsub(ccnorm(added_lines), "[ÒÔ]", "o");

exp1 := "point";

Related Objects

Event Timeline

Proc updated the task description. (Show Details)
Proc updated the task description. (Show Details)