Dan Mergens wrote:

I would have to defer to the regular expression experts, but VIM does not use 
the standard regular expressions that work on the command line, in say, Linux. 
Specifically, in the example cited, '/s' was used for whitespace matching, 
which is not available in standard regular expressions (c.f. GNU regular 
expression implementation).


Regular expression
From Wikipedia, the free encyclopedia
Jump to: navigation <http://en.wikipedia.org/wiki/Regular_expression#column-one>, search <http://en.wikipedia.org/wiki/Regular_expression#searchInput> In computing <http://en.wikipedia.org/wiki/Computing>, a *regular expression* (abbreviated as *regexp* or *regex*, with plural forms *regexps*, *regexes*, or *regexen*) is a string <http://en.wikipedia.org/wiki/String_%28computer_science%29> that describes or matches a set <http://en.wikipedia.org/wiki/Set> of strings, according to certain syntax <http://en.wikipedia.org/wiki/Syntax> rules. Regular expressions are used by many text editors <http://en.wikipedia.org/wiki/Text_editor> and utilities to search and manipulate bodies of text based on certain patterns. Many programming languages support regular expressions for string manipulation. For example, Perl <http://en.wikipedia.org/wiki/Perl> and Tcl <http://en.wikipedia.org/wiki/Tcl> have a powerful regular expression engine built directly into their syntax. The set of utilities (including the editor sed <http://en.wikipedia.org/wiki/Sed> and the filter grep <http://en.wikipedia.org/wiki/Grep>) provided by Unix <http://en.wikipedia.org/wiki/Unix> distributions were the first to popularize the concept of regular expressions.


OK: the term "regular expression" is somewhat loose; there is no "strict regular expression". As Wikipedia mentions, sed and grep were the first to come up with the concept, and Vim is an extended version of their concept. Perl, tcl, bash/ksh/zsh/etc, all have their own variants. None of these are the "defining authority", BTW. Vim and Perl's regular expressions are amongst the most powerful, although they differ from one another.

Regards,
Chip Campbell




Reply via email to