[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [TSVN] issuetrackers and regex

From: SteveKing <steveking_at_gmx.ch>
Date: 2005-02-12 12:17:00 CET

Toby Johnson wrote:

>> Always check if the lib supports lookahead/lookbehind! There are a lot
>> of libs out there which only support a small part of the whole regex
>> specs from perl. Even Scintilla has a regex class in it, but that one
>> is very limited.
>
> I don't get why lookahead/lookbehind is so important. Couldn't the user
> simply be given the ability to specify which backreference to use as the
> bugtraq id? Is there some other aspect of lookaheads other than the
> ability to avoid using a backreference?

- there is no 'standard' for regex
- the de-facto standard is the implementation of Perl
- there's however a POSIX standard for regex, but that's not used by
most libraries because it's slower than the Perl one, hasn't as many
features and some other reasons
- Perl (and many others) have lookahead/lookbehind, which users are used
to and would miss if we wouldn't implement it too.
- Lookahead/lookbehind can be used to match a string, but only return a
part of that matched string. Example:
You want to find all numbers, which are preceeded by the word 'number'.
Without lookahead/lookbehind, the regex would always return "number
XXX", but with that feature you could write a regex which would just
return "XXX" but still make sure that it's preceeded by 'number'.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Sat Feb 12 12:17:32 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.