On Aug 2, 2006, at 12:21, Justin C. wrote:
As far as I can see, it’s not in the documentation. I found it by
accident. But, yes, the scan method is better.
Oh, my gosh. If only you’d posted this little tidbit two days ago, I’d
have saved a couple hours of code-wrangling.
For sorting purposes, I needed to turn something like
I started with str.split(/[.]|@/), but then I’d lose where the @ went.
I tried turning it into
[“one-and”, “.”, “two”, “@”, “three”, “.”, “net”]
so I could .reverse that, but without positive look-behind, I couldn’t
find any way to detect the break after the dot except with \w, which
would also trigger after the hyphen.
After hours of work, I ended up with something that was not only long
and confusing, involving .collect and an inner search loop and other
stuff, but when I brought it back up to check it for this email
message, I discovered that it didn’t even actually work correctly.
And all along, all I needed to do was change
Dang. And thanks!