Subj : RegExp Behaviour in FSE
To : Angus McLeod
From : Deuce
Date : Thu Mar 02 2006 12:45 pm
Re: RegExp Behaviour in FSE
By: Angus McLeod to Deuce on Thu Mar 02 2006 12:54 am
> > The s flag wouldn't need any special handling at all since it merely expa
> > what . matches to include newlines. So your example would work as you ex
> > with the m flag, and not match anything otherwise. ie:
> >
> > $_="Two line\nParagraphs\n";
> > print "No flags\n" if(/^Para/);
> > print "m flag\n" if(/^Para/m);
>
> Which seems to me to be intuitive.
>
> > Further, if it included soft CRs, that would be an extra bit of whitespac
> > where there "really" isnt.
>
> Well, the separation between the last word on one line and the first word
> on the next is in fact "whitespace". Whether it is a space character or a
> newline, it is still whitespace and matches \s. So if you treated a soft
> CR like a hard CR, you're doing the right thing, because (presumably) for
> the auto-wordwrap to ahve kicked in, the user must have tyoed a space or
> tab or something at that point in the input text.
>
> To completely throw a spanner in the works: Quoting. How will you treat
> something like
>
> > yada yada yada yada yada yada yada yada yada yada yada yada Dumb
> > User yada yada yada yada yada yada yada
>
> when searching for /Dumb User/ or even /Dubm\s/User/m ? ;-)
Well, I can't say it seems completely intuitive, since your example would
actually not have done what you said it would have. :-)
As for adding a soft CR, the spaces are *still* at the end of the line... so if
soft CRs were expanded to hard, you'd need /Dumb\s+User/ reather than
/Dumb\sUser/ or /Dumb User/
As for quoting, I plan on using Deep Magic for it when possible. Since this
editor is runnign inside of Synchronet, thanks to reply linking, there's a VERY
good chance that the editor can actually read from the original message itself
and requote to fit... ie: it could restore the missing data from this:
DE> AM> DE> AM> DE> AM> DE> AM> DE> The fix is simply to use the correct flags
To this:
x8> DE> The fix is simply to use the correcty flags in the regex... m or s as a
And possibly even rewrapping it to fit in the smaller width.
x8> DE> The fix is simply to use the correcty flags in the regex... m or s as
x8> DE> appropriate.
The quoting indicators wouldn't count as part of the string.
---
This sig is not directed at Jazzman.
---
� Synchronet � My Brand-New BBS (All the cool SysOps run STOCK!)