Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

RegEx works in file search, but fails in "Find in Project" #9251

Closed
paulchrablass opened this issue Oct 22, 2015 · 3 comments
Closed

RegEx works in file search, but fails in "Find in Project" #9251

paulchrablass opened this issue Oct 22, 2015 · 3 comments

Comments

@paulchrablass
Copy link

Hi,

I don't know if this is really an error or I'm just missing something, but the following behaviour seems odd to me.

I'm using RegEx to find and replace some html patterns.

Text to find:

</div>
<!-- end: main body -->

Text to replace

</main>
<!-- end: main body -->

RegEx I'm using

<\/div>(\s|\n)*<\!--\send:\smain\sbody\s-->

This works fine when I use it in a single file, but fails when I use the Find in Project search feature.

I'm using Atom 1.0.19 on Mac OS X 10.10.5 (14F27).

I created a few files for testing, you can find them at https://www.dropbox.com/s/25wr27ys6mzy2o7/atom-test.zip?dl=0

You can recreate this error by searching in one file for

<\/div>(\s|\n)*<\!--\send:\smain\sbody\s-->

and then use it with the Find in Project search.

@jeancroy
Copy link
Contributor

From what I understand Find in Project use atom/scandal which seems to do regex search on a line per line basis. Because your regex span multiple line, it'll never match.

Alternatively other operation are done on chunk of text, and while there's some check to ensure the chunk will cut on a newline, there's no grantee the chunk will not cut in between those lines.

@benogle
Copy link
Contributor

benogle commented Oct 27, 2015

Sorry about this and thanks for the report. Closing in favor of atom/scandal#5

@benogle benogle closed this as completed Oct 27, 2015
@lock
Copy link

lock bot commented Jan 19, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants