<i>string is lower, upper not consistent with Unicode database and other languages</i> status still Open with 3 other changes
by
.
D 2025-07-23T17:08:27.350
J icomment At\sleast\sregarding\sRE,\sI\sam\sunsure\sit\sshall\sbe\salways\strue...\r\n\r\nFor\sinstance\sPCRE\sand\sPCRE2\sdon't\sconsider\sit\sas\slowercase:<br/>\r\n(`\\p{Ll}`\stoken\sis\sthe\ssame\sas\s`[[:lower:]]`\sin\stcls\sNFA)\r\n\r\n```\r\n%\sregexp\s-type\spcre\s{^\\p{Ll}+$}\s\\u0061\\u00e4\\u0430\r\n1\r\n%\sregexp\s-type\spcre\s{^\\p{Ll}+$}\s\\u00aa\r\n0\r\n```\r\nor\sPoC\sfrom\sbash:\r\n\r\n```\r\n$\sprintf\s"\\\\u0061\\\\u00e4\\\\u0430\\n"\s|\spcre2grep\s-q\s'\\p{Ll}'\s&&\secho\s1\s||\secho\s0\r\n1\r\n$\sprintf\s"\\\\u00aa\\n"\s|\spcre2grep\s-q\s'\\p{Ll}'\s&&\secho\s1\s||\secho\s0\r\n0\r\n```\r\n\r\nAlso\sJS\sagrees\swith\sthat:\r\n\r\n```\r\n>\s/^\\p{Lowercase_Letter}+$/u.exec("\\u0061\\u00e4\\u0430")\s&&\strue\r\ntrue\r\n>\s/^\\p{Lowercase_Letter}+$/u.exec("\\u00aa")\s&&\strue\r\nnull\r\n```\r\n\r\nIt\scan\sbe\ssimply\sthe\sbugs\sin\sboth\sRE-engines,\sbut\sthe\sroot\sof\sissue\smay\sbe\sdifferent...\r\n\r\nApropos\sother\slangs\slike\sPython\sdoes\sreport\sit\sas\slowercase.\sThey\sdo\sindeed,\sbut\show\sabout\salternative\ssimply\slogic\s-\scould\sit\sbe\scalled\slowercase\sif\sthere\sis\ssimply\sno\suppercase\sfor\sthat\schar?\r\n\r\nWith\sother\swords,\swhy\sthen\sthis\sbehaves\slike\sit\sbehaves\shere?\r\n\r\n```\r\n>>>\s"\\u00aa".islower()\r\nTrue\r\n>>>\s"\\u00aa".isupper()\r\nFalse\r\n>>>\s"\\u00aa".lower()\s==\s"\\u00aa".upper()\r\nTrue\r\n>>>\s"\\u00aa"\s==\s"\\u00aa".lower()\sand\s"\\u00aa"\s!=\s"\\u00aa".upper()\r\nFalse\r\n```\r\nUsing\sthe\slogic\s(detect\slowercase\sonly\sif\sit\shas\suppercase\stoo),\smay\sbe\sthe\sexplanation\sfor\sthe\sissues\swith\sRE.\r\n\r\nYes,\sthere\sare\salso\sregular\slowercase\scharacters\sthat\sdo\snot\shave\scorresponding\suppercase\srepresentations,\slike\sthe\sGerman\ssharp\ss\s(ß),\sthat\sdo\snot\shave\sa\sdirect\suppercase\sequivalent.\r\nJust\stake\sa\slook\swhat\spython\sdoes\sfor\sthat\schar:\r\n\r\n```\r\n>>>\s"ß".lower()\s==\s"ß".upper()\r\nFalse\r\n>>>\s"ß"\s==\s"ß".lower()\sand\s"ß"\s!=\s"ß".upper()\r\nTrue\r\n>>>\s"ß".lower()\r\n'ß'\r\n>>>\s"ß".upper()\r\n'SS'\r\n```\r\n\r\nAnother\scause\s(why\sREs\sdon't\srecognize\sthem)\smay\sbe\ssimply\sthe\sdecision\sto\signore\sall\schars\sfrom\s[other\sletters](https://www.compart.com/en/unicode/category/Lo),\s[modifier\sletters](https://www.compart.com/en/unicode/category/Lm)\sand\sother\ssimilar\scategories\s(for\sunknown\sbut\smaybe\sjustified\sreasons).\r\n\r\nHowever\sI\sreally\sdon't\sunderstand\show\sordinal\sindicators\s(which\sclass\sbasically\srepresents\sindicators\sfollowing\sordinal\snumbers),\sor\seven\ssuch\sas\s[modifier\sletter](https://www.compart.com/en/unicode/category/Lm)\slike\sʶ\s("\\u02B6"),\swhich\sis\scapital\sinverted\sR,\smay\sbe\slowercase\sat\sall...\r\n\r\nNot\strying\sto\sconvince\sor\spropagate\swhat\sis\sright\shere,\sbut\sto\sshow\sthe\ssubject\smay\sbe\smore\scomplex\sas\sit\sis.
J login sebres
J mimetype text/x-markdown
K 1ecea01196a19b73226d5c822e5fdaf22111aa54
U sebres
Z e16e87b8afaad43585f271057426bb07