Skip to content

String.prototype.replace does not work with replacement patterns #938

Open

Description

@ChALkeR
> 'abc'.replaceAll(/(b)/g,'[$1]')
SmallString("a[$1]c")
> 'abc'.replaceAll(/(b)/g,'[$$]')
SmallString("a[$$]c")

Should be:

> 'abc'.replaceAll(/(b)/g,'[$1]')
'a[b]c'
> 'abc'.replaceAll(/(b)/g,'[$$]')
'a[$]c'

Activity

  1. added a commit that references this issue on Feb 9, 2026
  2. aapoalas commented on Feb 9, 2026

    @aapoalas
    Member

    Whoops right, we've completely forgot to consider replacement patterns.

  3. added
    enhancementNew feature or request
    and removed
    bugSomething isn't working
    on Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions