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

Enable regex's ^, $ and ^$ to be matched in file dialog #314

Merged
merged 1 commit into from
Nov 23, 2015
Merged

Enable regex's ^, $ and ^$ to be matched in file dialog #314

merged 1 commit into from
Nov 23, 2015

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Nov 20, 2015

Fixes #278

@msftclas
Copy link

Hi @Tyriar, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

@Tyriar
Copy link
Member Author

Tyriar commented Nov 20, 2015

Find and replace /^/

caret_find_replace

Find and replace /$/

dollar_find_replace

Find and replace /^$/

both_find_replace

@msftclas
Copy link

@Tyriar, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, MSBOT;

@joaomoreno
Copy link
Member

Looks awesome.

do {
m = searchRegex.exec(text);
if (m) {
result.push(new Range(lineNumber, m.index + 1 + deltaOffset, lineNumber, m.index + 1 + m[0].length + deltaOffset));
var range = new Range(lineNumber, m.index + 1 + deltaOffset, lineNumber, m.index + 1 + m[0].length + deltaOffset);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use var in TS when let and const are available?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because const and let are not used in the file yet `var is extensively and there's not mention in the coding guidelines.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of code was written before TypeScript added support for let. We didn't do a full pass to replace all usages

@alexdima
Copy link
Member

@Tyriar This is great! Thank you so much! ❤️

alexdima added a commit that referenced this pull request Nov 23, 2015
Enable regex's ^, $ and ^$ to be matched in file dialog
@alexdima alexdima merged commit cef9583 into microsoft:master Nov 23, 2015
@Tyriar Tyriar deleted the 278_blank_line_regex branch November 29, 2015 02:23
@ghost
Copy link

ghost commented Sep 11, 2017

Guys i Want the oposite of that if i want to find this pattern }{ nad i want to make line break like

I have this

{"index":{"_id":0}},{"index":{"_id":0}}

And i want this

{"index":{"_id":0}}
{"index":{"_id":0}}

is any wat to filter for },{ And add line break in midle

}
{

@alexdima
Copy link
Member

@atlabiz

  • search for },{
  • replace with },\n{
  • enable regex to have the \n in the replace field mapped to a newline and not to the literals \ and n.

kapture 2017-10-24 at 9 57 29

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regex unable to find/replace blank lines
5 participants