From: Aaron J. Grier Date: 21:30 on 02 Nov 2007 Subject: regex end-of-word GNU: \> , \< BSD: [[:>:]] , [[:<:]] WTF: ??? the two are not compatible. I guess I'm matching on whitespace and beginning or end-of-line to do what I want. \>\< [[:>:]] [[:<:]] the above is a picture of me poking my eyes out with incompatible end-of-word regexps.
From: Peter da Silva Date: 23:29 on 02 Nov 2007 Subject: Re: regex end-of-word On 02-Nov-2007, at 16:30, Aaron J. Grier barely brushed the surface of the potential pool of hate that awaits one who wants to grok regular expressions in all fullness... > GNU: \> , \< Early extension, originated in "vi". Breaks traditional regexps. > BSD: [[:>:]] , [[:<:]] POSIX-style, but not POSIX. provides better compatibility with traditional regexps by overloading character classes. Perl regexps are a third style. GNU has about 30 options to turn on and off different sets of extensions. There's a couple of different Java regexps, one of which is an improper subset of GNU regexp. Most of these have basic and enhanced versions. AmigaDOS file matching is actually a regular expression language with a unique syntax. SNOBOL and derivatives. There are LISP and Scheme regular expression languages, which are of course s-expressions. Icon, which isn't a SNOBOL derivative but created by the same bloke, makes the operations involved in regular expression evaluation part of the language. Prolog of course takes pattern matching to a whole new level.
From: Peter da Silva Date: 23:42 on 02 Nov 2007 Subject: Re: regex end-of-word Go soak your brain in regular expression hate at http://www.regular- expressions.info/refflavors.html . Nota bene: this is nowhere near a complete list, in fact it doesn't even include the hate that started this thread.
From: Juerd Waalboer Date: 23:48 on 02 Nov 2007 Subject: Re: regex end-of-word Peter da Silva skribis 2007-11-02 18:29 (-0500): > Perl regexps are a third style. Oh, with Perl 6, a forth too!
From: Peter da Silva Date: 23:53 on 02 Nov 2007 Subject: Re: regex end-of-word On 02-Nov-2007, at 18:48, Juerd Waalboer wrote: > Peter da Silva skribis 2007-11-02 18:29 (-0500): >> Perl regexps are a third style. > Oh, with Perl 6, a forth too! Forth regexps?
From: Jarkko Hietaniemi Date: 23:57 on 02 Nov 2007 Subject: Re: regex end-of-word Peter da Silva wrote: > On 02-Nov-2007, at 18:48, Juerd Waalboer wrote: >> Peter da Silva skribis 2007-11-02 18:29 (-0500): >>> Perl regexps are a third style. > >> Oh, with Perl 6, a forth too! > > Forth regexps? Sure. http://ffl.dvoudheusden.net/ Next! > >
From: Juerd Waalboer Date: 23:59 on 02 Nov 2007 Subject: Re: regex end-of-word Peter da Silva skribis 2007-11-02 18:53 (-0500): > On 02-Nov-2007, at 18:48, Juerd Waalboer wrote: > >Peter da Silva skribis 2007-11-02 18:29 (-0500): > >>Perl regexps are a third style. > >Oh, with Perl 6, a forth too! > Forth regexps? s/\<forth\>/fourth/ s/[[:<:]]forth[[:>:]]/fourth/ s/\bforth\b/fourth/ s/«forth»/fourth/, s/<?wb>forth<?wb>/fourth/
From: A. Pagaltzis Date: 00:08 on 03 Nov 2007 Subject: Re: regex end-of-word * Juerd Waalboer <juerd@xxxxxxxxxxx.xx> [2007-11-03 00:55]: > Peter da Silva skribis 2007-11-02 18:29 (-0500): > > Perl regexps are a third style. > > Oh, with Perl 6, a forth too! No, those aren't regexps. (And that's a good thing.) Regards,
From: Phil Pennock Date: 02:14 on 03 Nov 2007 Subject: Re: regex end-of-word On 2007-11-02 at 18:29 -0500, Peter da Silva wrote: > On 02-Nov-2007, at 16:30, Aaron J. Grier barely brushed the surface of the > potential pool of hate that awaits one who wants to grok regular > expressions in all fullness... I managed to smack down on people using egrep. All of our C++ binaries (ie, all the non-Java stuff) uses PCRE regexps; the Java stuff does too, I think; Python obviously does. So if people want more than grep(1), those around me now use pcregrep(1); at least that way we have consistent syntax. Closest thing there is, in this day and age, with so many scripting languages using the PCRE libraries too, and those are the ones which are actually being updated to handle UTF-8 and the non-Western world. Reliably, not just "well, on this platform, the regexp libraries were modified to handle locale, provided that it's either 8-bit or one of this list of 16-bit wide-charsets, so I don't know what your problem is, just always use the system regexp libraries". Gaaah! Twazzocks. > AmigaDOS file matching is actually a regular expression language with a > unique syntax. The only one which actually makes any kind of mnemonic sense, too. Pity you had to learn which commands didn't take patterns and so needed you to use one of those wrapper commands; the ones which took the regexps-alike and invoked the command repeatedly, there was one for commands which just took one filename and one for commands which took two. Can't remember the name anymore. Damn, I could actually understand and be quickly productive in a wordprocessor back then, and could find how to align stuff to write a letter properly and simply, without having to use a template and then fight the template. And the wordprocessors were quick and responsive and didn't tend to crash. It's pathetic that an A1200 on an MC68EC020 processors gave a better interactive user experience for WYSIWYG document editing than dual-core 2+GHz "modern" systems running any non-niche current OS of your choice. (I'm prepared to consider that I might be mis-remembering the responsiveness of the A500, with rose-tinted spectacles, but the A1200 was definitely more responsive than anything I've tried in the last few years). -Phil
From: Peter da Silva Date: 05:08 on 03 Nov 2007 Subject: Re: regex end-of-word > Damn, I could actually understand and be quickly productive in a > wordprocessor back then, and could find how to align stuff to write a > letter properly and simply, without having to use a template and then > fight the template. And the wordprocessors were quick and responsive > and didn't tend to crash. That's because it was a text editor with basic layout, not a phototypesetter and spreadsheet that HAS to be compatible with a program that was badly designed from the start. Apple's rich text mode in Cocoa is pretty close.
Generated at 10:26 on 16 Apr 2008 by mariachi