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 www.google.com and also WwW.google.com
The www is where i’m having issues.
Should it support either
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.
Thanks, this is what I have written so far:
To be clear, URL (eg “http://WwW.google.com/path/TO/resource.TXT”) or Domain Name only (eg “WwW.google.com”)?
It also doesnt hurt to post a few examples of what you do/not want to match…
Try this regex:
You can test it here: https://regex101.com/
[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:
Thank you very much. This is the solution I was looking for, it works perfectly.