what's an unicode alphabetic character? I misunderstood
isAlpha(), I used to think it's to validate letters like a, b, è,
é .. z etc but isAlpha('º') from std.uni module return true. How
can I validate only the letters of an unicode alphabet in D or
should I write one?
I know I can do:
bool
On 09/11/2014 08:04 PM, AsmMan wrote:
> what's an unicode alphabetic character?
Alphabetic is defined as Lu + Ll + Lt + Lm + Lo + Nl + Other_Alphabetic,
all of which are explained here:
http://www.unicode.org/Public/5.1.0/ucd/UCD.html#General_Category_Values
> I misunderstood isAlpha(), I
On Friday, 12 September 2014 at 04:04:22 UTC, Ali Çehreli wrote:
On 09/11/2014 08:04 PM, AsmMan wrote:
> what's an unicode alphabetic character?
Alphabetic is defined as Lu + Ll + Lt + Lm + Lo + Nl +
Other_Alphabetic, all of which are explained here:
http://www.unicode.org/Public/5.1.0/uc
On 09/11/2014 11:38 PM, AsmMan wrote:
> If I want ASCII and latin only alphabet which range should I use?
> ie, how should I rewrite is_id() function?
This seems to be it:
import std.stdio;
import std.uni;
void main()
{
alias latin = unicode.script.latin;
assert('ç' in latin);
asse
On Friday, 12 September 2014 at 07:57:43 UTC, Ali Çehreli wrote:
On 09/11/2014 11:38 PM, AsmMan wrote:
> If I want ASCII and latin only alphabet which range should I
use?
> ie, how should I rewrite is_id() function?
This seems to be it:
import std.stdio;
import std.uni;
void main()
{
alia
Thanks Ali, I think I get close:
bool is_id(dchar c)
{
return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= 0xc0
&& c <= 0x0d || c >= 0xd8 && c <= 0xf6 || c >= 0xf8 && c <= 0xff;
}
this doesn't include some math symbols. like c >= 0xc0 did.