Re: If you were inventing CoBOL...
From: Michael Wojcik (mwojcik_at_newsguy.com)
Date: 09/13/04
- Next message: Robert Wagner: "Re: Payment systems (was: If you were inventing CoBOL...)"
- Previous message: JerryMouse: "Re: List boxes in Microfocus Dialog System/Net Express?"
- In reply to: Robert Wagner: "Re: If you were inventing CoBOL..."
- Next in thread: Michael Wojcik: "Re: If you were inventing CoBOL..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 13 Sep 2004 19:37:56 GMT
In article <qj81k01i45kfl7l4r5jo9n6l54q6jtkumb@4ax.com>, Robert Wagner <robert@wagner.net.yourmammaharvests> writes:
> On Thu, 09 Sep 2004 18:40:36 +0100, Frederico Fonseca
> <real-email-in-msg-spam@email.com> wrote:
>
> >And when it cames to doing regular expressions then there is no editor
> >like vi that I know of.
Actually, traditional vi (and POSIX / SUS vi) regular expression
support is limited. The BRE (basic regular expression) syntax used
by ex and vi doesn't support alternation (in the general case - it
supports limited forms), which makes it less expressive than formal
RE syntax and can, in fact, be a real pain.
This is another thing that vi clones often improve on. vim, for
example, uses "\|" to express alternation, similar to egrep; the
vertical-bar character is often used for alternation in formal syntax
as well, of course. vim's "regular expressions" actually include
syntax that makes them more powerful, in a strict and formal sense,
than real regular expressions. If you use a search in vi like:
/\(a*\)b*\1
(which means "some number of a's, followed by some number of b's,
followed by just as many a's as you had before the b's") you've just
specified a language which is recursive but not regular; it requires
at least a push-down automaton to recognize it. It might be
possible with multiple \<number> expressions to specify a language
which is recursively enumerable but not recursive, making vim's
search capability more powerful than a PDA; I haven't given it much
thought.
> The regular expression processor in my editor is written in Cobol.
And indeed plenty of editors besides vi and its derivatives have
regular-expression searches, and some even have proper RE search-
and-replace, with the ability to select portions of the search text
in the replacement text. There was a time when RE search-and-
replace was an unusual feature, but these days it's pretty common.
-- Michael Wojcik michael.wojcik@microfocus.com O sometimes, nevertheless, The labourer at his instrument or tractor, Bending into a state of merge with objects, Finds the same love that, from a machine of sex, Steps down as Venus to her invoker. -- George Barker
- Next message: Robert Wagner: "Re: Payment systems (was: If you were inventing CoBOL...)"
- Previous message: JerryMouse: "Re: List boxes in Microfocus Dialog System/Net Express?"
- In reply to: Robert Wagner: "Re: If you were inventing CoBOL..."
- Next in thread: Michael Wojcik: "Re: If you were inventing CoBOL..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|