Skip to content

Add advanced regex replace for code editor #243

Open

Description

@7evenk

It should be possible to define a callback function in the replace field.

image

So it is possible to do math operations during replacement.

const regex = /(grid-row:)([0-9]*)/g;
let replacedText = text.replaceAll(regex, (match, g1, g2) => {
	let result = parseInt(g2) + 1;
	return g1 + result;
});

Activity

  1. self-assigned this
    on Dec 15, 2022
  2. added
    enhancement
    on Dec 16, 2022
  3. jogibear9988 commented on Feb 8, 2025

    @jogibear9988
    Member

    I think this should be a extension for monaco

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions