This is an example of what the regex would and wouldn't match:
# Matches
AAAA: aaaa
# Matches
ABCD: abcd
# Doesn't match
AAAA: abcd
# Doesn't match
AAAA: AaAa
How can I accomplish this?
I found this, but it doesn't work for matches because \L
transforms the matches in the replace. Besides, \L
seems to be only available in PHP and not in Javascript:
This works, but only when the case-insensitive option is set and it matches the last example:
(\w+): \1