Just trigger in my mind when I was going through some websites were they having upper case and lower case combination in url something like
Now as I know we should always use lowercase in url but have not idea about technical reason. I would like to learn from you expert to clear this concept why to use lowercase in url. What are the advantages and disadvantages for upper case url.
Say you have a word "Aabrakadaabra" and what you want to do is find the repeating characters and replace them with a single one. which in our case should return "Abrakadabra".
what i did was
re.sub(r"([a-zA-z])\1",r"\1","Aabrakadaabra") which returns 'Aabrakadabra' and this regex cannot catch when there is an uppercase and a lowercase repeating. Im not sure if there is an easy, one liner way to do this but any help would be educative.
This question already has an answer here:
I would like to insert a set of links in a text. The link is partly composed of a regex pattern. That works. But the captured group, which I have to use, consists of uppercase letters. But the link requires small letters.
text=re.sub(r'firstpart(FirstCapturedGrp)(SecondCapturedGrp)', r'<a href="www.bla.com/\1/\2', 'str')
Second Captured group Uppercase in the source, but needs to be lowercase. Is there a way to convert it?
Suppose you have this string:
What is the fastest way to find where the first upper case character is? (
T in this example)
I am worried about performance as some words are quite long.
Is there a way to convert a string from uppercase, or even part uppercase to lowercase?
E.g. Kilometers --> kilometers.