On Wednesday, 7 de September de 2011 08:57:17 [email protected] wrote: > 1. It is impossible to do big changes to QRegExp without breaking existing > code. Please keep the compatibility goals of Qt5 in mind. Remember that we > want to MINIMIZE breakage and not repeat Qt3 to Qt4.
I wasn't asking any changes to QRegExp. The idea is to move that class, in its
entirety, to a separate library. That way, people using it will have the
current behaviour and even keep source compatibility.
The challenge will be to deal with the QString methods that take QRegExp.
Probably mark them inline and implement them in the qregexp.h header (which is
in the other library).
> 2. While it might be
> interesting to write yet-another regular expression engine, there seem to
> be more exciting projects around, given that the problem has been solved a
> couple of times already.
And I wholeheartedly agree. Let's not write another engine. Let's use an
existing engine.
The question is only which one.
> So why not keep QRegExp as it is? Benefit: no breakage, and existing use
> cases work OK. If we think that using javascript or boost is not sufficient
> for new code, and we need to wrap an existing engine with a Qt-style API,
> we can do that as a separate module. If that turns out OK and is accepted,
> we can then consider to merge whatever new regexp class we come up with
> QRegExp for Qt 6.
That's one option. The drawback is, of course, that QRegExp is slow, hardly
maintained (Jasmin used to maintain it) and has a non-standard syntax. There's
absolutely no one who wants to implement advanced features like forward
lookahead. Like you said yourself, there are more exciting projects aroudn.
So in my opinion, a replacement class that wraps around an *existing* engine
is a lot more interesting. The four engines that have been discussed so far
are:
- V8's
- PCRE
- boost::regex
- std::regex
> But do we really need that? In the longer run, wouldn't it be better to
> merge the other C++ efforts with Qt? Instead of yet another generation of
> Qt tools, why not make Qt more friendly towards std::?
We should. But at this time, std::regex is not standard. There's simply no way
we can use it everywhere. As of GCC 4.6, support is incomplete.
boost::regex is a 1 MB library that pulls in three ICU dependencies. I don't
know if our own ICU usage pulls in any of those three. Denis to confirm.
The engine in V8 carries the problems of the thread.
PCRE is fairly small, but it only operates in UTF-8. It would be an
interesting challenge to convert the index positions in the UTF-8 string back
to QString indexes.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Qt5-feedback mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
