foxreplace icon indicating copy to clipboard operation
foxreplace copied to clipboard

Add an option for multiline matching

Open GoogleCodeExporter opened this issue 10 years ago • 6 comments

Currently, multiline matching is enabled for all substitutions. Make it an 
option for each substitution.

Original issue reported on code.google.com by [email protected] on 19 Dec 2012 at 11:29

GoogleCodeExporter avatar Aug 21 '15 18:08 GoogleCodeExporter

Correction: Currently, multiline matching is not enabled for any substitution. 
Make it an option for each substitution.

Original comment by [email protected] on 23 Dec 2012 at 1:40

GoogleCodeExporter avatar Aug 21 '15 18:08 GoogleCodeExporter

A workaround in the meantime can be to use \n within the regex to represent 
newline (that works for me but others may need \r or \m). Not always a useful 
workround.

Original comment by [email protected] on 21 Apr 2013 at 6:06

GoogleCodeExporter avatar Aug 21 '15 18:08 GoogleCodeExporter

Hi I think this is probably not a FoxReplace issue, but an issue of regular 
expressions in JavaScript.

I read somewhere that . does not match newline characters and that in case 
newline should be matched you can use
[\s\S] instead of the . so the expression .* would become [\s\S]*
and if this does what you need, I think it is even a better choice than to 
change extend FoxReplace, because this way you can distingiuish cases in which 
you want to match any character within a line and cases in which you want to 
match absolutely all possible characters in one and the same regexp (it makes 
it much more powerful).

Greetings
J

Original comment by [email protected] on 27 Jun 2013 at 6:14

GoogleCodeExporter avatar Aug 21 '15 18:08 GoogleCodeExporter

Hi, the issue isn't about . but about $ and ^. The multiline flag has the 
following effect:

Treat beginning and end characters (^ and $) as working over multiple lines 
(i.e., match the beginning or end of each line (delimited by \n or \r), not 
only the very beginning or end of the whole input string)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
/RegExp

So it's still a valid enhancement, and since it will be a flag for each 
individual substitution you will still have the power to distinguish between 
any case ;)

Original comment by [email protected] on 27 Jun 2013 at 9:36

GoogleCodeExporter avatar Aug 21 '15 18:08 GoogleCodeExporter

I understood the issue and I have the same problem - that - I don't know how to operate in multiline mode.

This issue is marke as solved, but having read all of the above I could not understand how to switch multiline mode on and off though json file.

could you please summarize what should I do to work in "multiline mode"?

I have been facing this issue for several years.

I don't think I found multiline mode mentioned anywhere in help manual also. please mention it somewhere in that.

thanks.

vsrawat avatar Dec 13 '17 06:12 vsrawat

Hi @vsrawat, sorry for the late response. This issue is not closed as this is not implemented. What are closed are the two related issues you can see just above your comment.

Woundorf avatar Dec 15 '17 20:12 Woundorf