[patch] improved ignore pattern matching (#57637)
Jan Hudec
bulb at ucw.cz
Mon Nov 27 06:55:14 GMT 2006
On Sun, Nov 26, 2006 at 08:34:16PM +0200, Jari Aalto wrote:
> Kent Gibson <warthog618 at gmail.com> writes:
> [...]
> > Not supporting whitespace in regexes would be weird. In regexes
> > whitespace is normally matched verbatim - if that's how you want to
> > use it. Or you can use the special character groups as you suggest.
> > Leave it to the user.
>
> Sure, I was just think that someone wrotes:
>
> <SPACE><TAB>
>
> and the other person loads that to editor, which converts it to
> following upon save:
>
> <SPACE><N spaces>
>
> Provided that the editor has setting "always store files without tabs,
> using spaces only".
We are NOT talking about LEADING whitespace, since there CAN'T be
leading whitespace in a regex, because there always has to be the 'RE:'
prefix before it. Any editor that changes non-leading whitespace is just
plain brain-damaged.
> Forcing people to use \s always will prevent mistakes like these at
> the source. It is also hard to see "live" what character are there:
>
> <SPACE><TAB>: perceived as? <SPACE><N spaces> or <TAB><SPACE> or ...
>
> Practically unvisible unless you turn on some magical "show tabs"
> mode.
If you fear mistakes, you still CAN use \s for whitespace. But many
users are used to writing [ \n] all over the place since POSIX
regular expression do NOT recognize \s.
--------------------------------------------------------------------------------
- Jan Hudec `Bulb' <bulb at ucw.cz>
More information about the bazaar
mailing list