Re: Expression in QRegExp
QRegExp docs are quite clear IMO. This regexp will match any string composed of :
- a sequence of one or more letters (basic latin alphabet)
- a colon ( ':' ) the (double due to C string escaping) backslash prevents this character from having any special meaning (though I don't remember it having one, well it will work anyway...)
- a sequence of ANY characters of ANY length (zero or more)
You could of course replace the set by \\D (non-digit class) but it might make more sense to use \\w (word class).
In a nutshell, this regexp certainly does NOT match URLs. The simplest description is that it matches key:value pairs key being made of latin letters and value of any characters.
Re: Expression in QRegExp
hum. its weird this doesnt match Urls... anyways, thanks!
Re: Expression in QRegExp
It will match URLs (ones with schemas) but only by accident (it will match u bunch of other things as well). If you want an expression for matching URLs then something like this is better:
Code:
QRegExp("[A-Za-z][A-Za-z0-9]*:\\/\\/.*")
It will at least make sure there are two slashes behind the colon. And it will allow schemas containing digits. I escaped the slashes themselves "just in case".
Re: Expression in QRegExp
Oh, that will help
thank you.