Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex flags -- i.e. multiline #13

Open
freddyli opened this issue Apr 24, 2020 · 0 comments
Open

Regex flags -- i.e. multiline #13

freddyli opened this issue Apr 24, 2020 · 0 comments

Comments

@freddyli
Copy link

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 =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant