D 2012-01-04T20:51:50 J icomment \n\nallow_comments\s-\s0\n\nRe-open,\sbecause\sit\sappears\sthat\ssome\sother\ncharacters\sgive\swrong\sresults\swith\n"string\sis\sgraph"\s(and\s"string\sis\scontrol"):\n\n%string\sis\sgraph\s\\u00a0\n1\n%string\sis\sgraph\s\\u2028\n1\n%string\sis\sgraph\s\\u2029\n1\n\nComparing\sthis\swith\sthe\sRuby\simplementation:\n>/[[:graph:­]]/.match(­"\\u00a0")\n=>\snil\n>/[[:graph:­]]/.match(­"\\u2028")\n=>\snil\n>/[[:graph:­]]/.match(­"\\u2029")\n=>\snil\n\nThis\stells\sus\sthat\sspace\s(\\u0020)\sis\snot\nthe\sonly\scharacter\sthat\sneeds\sto\sbe\nexcluded\sfrom\s"string\sis\sgraph",\sbut\nall\scharacters\sin\sthe\sUnicode\sSPACE\ncathegories\s("Zs",\s"Zl"\sand\s"Zp"),\swhich\sis\nindeed\smore\slogical\n\nAnd,\swhile\swe\sare\son\sit\sanyway:\n%string\sis\scontrol\s\\u00ad\n0\n%string\sis\scontrol\s\\ue000\n0\n\nCompare\sthis\swith\sRuby:\n/[[:cntrl:­]]/.match(­"\\u00ad")\n=>\s#\n/[[:cntrl:­]]/.match(­"\\ue000")\n=>\s#\n\nThis\stells\sus\sthat\sfor\s"string\sis\scontrol"\swe\nneed\sto\stake\sthe\sUnicode\sclasses\s"Cf"\nand\s"Co"\sin\saccount\sin\saddition\sto\s"Cc"\n(NOT\s"Cs",\sbecause\sthat's\sfor\ssurrogates;\nRuby\sagrees\swith\sthat!)\n\nAll\sof\sthose\scharacters\sare\soutside\sof\sthe\nASCII\srange,\swhich\sexplains\swhy\sthis\nwas\snever\snoticed\sbefore.\n J login nijtmans J mimetype text/plain J resolution Accepted J status Open J username nijtmans K 3464428fffffffffffffffffffffffffffffffff U nijtmans Z ac548af7263c3a8755121ee50149b977