Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Global find and replace behavior drastically different than local w/ regex #1017

Closed
1 task done
envygeeks opened this issue Apr 26, 2018 · 5 comments
Closed
1 task done

Comments

@envygeeks
Copy link

Prerequisites

Description

mit\slicense$\n^$\n regexp does not work with global find and replace

Steps to Reproduce

  1. Create a file
  2. Open said file
  3. Add "MIT License\n\n"

Expected behavior: A match
Actual behavior: No Match
Reproduces how often: 100%

Versions

Atom : 1.26.0
Electron: 1.7.11
Chrome : 58.0.3029.110
Node : 7.9.0

Additional Information

screen shot 2018-04-26 at 8 16 22 am

screen shot 2018-04-26 at 8 16 42 am

@ghost
Copy link

ghost commented May 15, 2018

#218

4 years anniversary in just 6 days

@thomasjo
Copy link
Contributor

Closing as duplicate of #218.

@envygeeks
Copy link
Author

@thomasjo This isn't about \s this about \n^$\n, \s works regardless of scope.

@thomasjo
Copy link
Contributor

Perhaps I should have been more explicit in my comment above.

If you read the duplicate issue carefully, you will see that this is by design due to how the scandal library works; it splits each file into lines, and therefore only runs regex search patterns on line-by-line basis. In other words, searching across multiple lines is not supported with project-wide searches.


Ref: atom/scandal#5

@envygeeks
Copy link
Author

Ah boo, I didn't know that 😭. That explains a lot then. I've subscribed to that thread.

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

No branches or pull requests

2 participants