Subj : RegExp Behaviour in FSE To : Deuce From : Angus McLeod Date : Wed Mar 01 2006 10:22 am Re: RegExp Behaviour in FSE By: Deuce to All on Tue Feb 28 2006 23:42:00 > So, in fseditor.js, I plan on implementing for regular expression stuff (you > welcome Angus). However, I'm unsure of one teensly little thing... Appreciated! > Since fseditor does word wrapping, there isn't *really* an end of line unles > the user presses enter... so, should /^(.*)$/ match a single wrapped line, o > should it match from one CR to the next (in general, a complete paragraph)? > > How should the m and s flags interact with this? Okay, my immediate thoughts: The RE applies to a string. What string will it apply to? Presumably, selected text, or the entire document, depending. Selected text *or* the entire document, might consist of several paragraphs. Therefore, the un-flagged RE should refer to the entire unmodified string, selection or all. The RE should (IMHO) treat both hard *and* soft newlines as newlines. Soft newlines as inserted by an automated wordwrap are only a convenience for the user. There shouldn't be any confusion. If the user, looking at the text *sees* a newline, then the RE should respond as expected. Were I to apply /^para/m to this parabraph, for instance, it should match *twice*, even though one instance of the word 'paragraph' was explicitly wrapped by the ENTER key, and the other was auto wrapped. The 'm' and 's' flags should modify the behaviour of the RE as normal, but (IMHO) it should treat *both* hard and soft newlines as newlines. Thoughts? --- Playing: "Try & love again" by "Eagles" from the "Hotel California" album þ Synchronet þ Making sure Jason works OK at The ANJO BBS .