Set regex flags


I was wondering if there is a way to set the regex flag i for insensitive in Kobo. I want to use my regex to account for the uppercase and lowercase of URLs. e.g. it must accept and also

The www is where i’m having issues.

Should it support either www or WwW only?

No, it shouldn’t. It should also accept .CoM or HtTps or .orG etc. Basically any letter in the URL can be uppercase or lowercase, but it must still be a proper url.

Is this a finite list or an infinite list?

There is no user-settable flag on the XPath regex() function to make it case insensitive. But if you post your current (case-sensitive) URL regex expression, it can be readily modified to make it case insensitive.

1 Like

Thanks, this is what I have written so far:


To be clear, URL (eg “”) or Domain Name only (eg “”)?

It also doesnt hurt to post a few examples of what you do/not want to match…

1 Like

The regex should accept both the url and domain name.
A few e.g.:

HttPs:// or Google.coM - for websites that don’t use www

These examples should represent all the use cases.

Try this regex:


You can test it here:

[note: a few negative examples doesnt hurt… A regex that is too permissive is as useless as one too restrictive; eg the following will also happily accepts all of the above: ^.*$ ]

1 Like

Thank you very much. This is the solution I was looking for, it works perfectly.

1 Like