Skip to content

Regex flags -- i.e. multiline #13

@freddyli

Description

@freddyli

Hi there! I like your extension! For me to be even better it would be cool if it supported regex flags. For me especially the multi-line mode is important.

You could maybe also make it default in regreplace.ts:101

Currently:

	command.global === false ? new RegExp(regexQuery) : new RegExp(regexQuery, 'g');

Change to:

	command.global === false ? new RegExp(regexQuery, 'm') : new RegExp(regexQuery, 'gm');

Example

Then I could use it to auto-indent blank lines with this:

{
    "name": "Autoindent blank lines",
    "language": "python",
    "regexp": "^ *$(?=\\s*\\n( *)|)",
    "global": true,
    "replace": "$1"
}

Please consider an enhancement here. Or is this achievable in some other way?

Thank you =)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions