harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Liang <richard.lian...@gmail.com>
Subject [classlib] Requirement: Regex support for \p{javaDigit}
Date Wed, 28 Jun 2006 11:29:15 GMT
Hello All,

I'm trying to implement java.util.Scanner.nextInt, which requires a 
regular expression pattern to represent  "Integer". I find it's hard to 
express /NonASCIIDigit /because now Harmony regex does not support 
/NonASCIIDigit/.

As our regex has supported "\p{javaLowerCase}     Equivalent to 
java.lang.Character.isLowerCase()", to facilitate the development of 
j.u.Scanner, shall we provide support for "\p{javaDigit}", which is 
equivalent to java.lang.Character.isDigit()? I could provide patch for 
this feature if there is no objection. Thanks lot.
*
*You may want to refer to the number syntax in java.util.Scanner Spec:*
*/<QUOTE>
NonASCIIDigit  :: = A non-ASCII character c for which 
Character.isDigit(c) returns true

Non0Digit  ::= [1-Rmax] | NonASCIIDigit

Digit  ::= [0-Rmax] | NonASCIIDigit

GroupedNumeral  ::  = ( Non0Digit Digit? Digit? ( LocalGroupSeparator 
Digit Digit Digit )+ )

Numeral  ::= ( ( Digit+ )  |  GroupedNumeral )

Integer  ::= ( [-+]? ( Numeral ) )  |  LocalPositivePrefix Numeral 
LocalPositiveSuffix  |  LocalNegativePrefix Numeral LocalNegativeSuffix/
/</QUOTE>/


-- 
Richard Liang
China Software Development Lab, IBM 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message