Problem/Motivation

str_replace regex use case documentation could be improved.

Proposed resolution

If nothing else, another line similar to this one about PHP str_replace (docblock > around line 57)

 * All the rules for
 * @link http://php.net/manual/function.str-replace.php str_replace @endlink
 * apply. This means that you can provide arrays as values.

In other words, something like "When regex is true, all the rules for preg_replace apply? -- i.e. "that means your replace string can include backreferences." -- and maybe an example, but I understand if that would be too many examples (or maybe the existing regex example could be updated to include a backreference).

Remaining tasks

(do, or do not)

I'd be happy to submit a patch if there's support for the idea. Thank you!

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alisonjo315 created an issue. See original summary.

alison’s picture

Status: Active » Needs review

matroskeen’s picture

Issue tags: +LutskGCW22

matroskeen’s picture

Status: Needs review » Fixed

Documentation improvements are always welcome! Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.