Skip to content

String.replace mishandles multiline replaces #22

@ghost

Description

s = 'one\ntwo\nthree'
print(s.replace(/^/mg, '@'))

This prints (puts two @@ in the 2nd and subsequent lines):
@one
@@two
@@three

Should print:
@one
@two
@three

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions