diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-03-14 14:48:56 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-03-14 14:48:56 -0400 |
| commit | a1662cac9d27581cffda8e6d1b2ede9fa346724d (patch) | |
| tree | 35259598045393c4bf11c49c8896001fd0cf8121 /BJC-Utils2/src/main/java/bjc/utils/funcutils/DoubleMatcher.java | |
| parent | 4f572b2db312ae4368afd031b50ce3c78a12fc8d (diff) | |
Formatting
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcutils/DoubleMatcher.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/funcutils/DoubleMatcher.java | 87 |
1 files changed, 43 insertions, 44 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcutils/DoubleMatcher.java b/BJC-Utils2/src/main/java/bjc/utils/funcutils/DoubleMatcher.java index 8d0715d..03227ed 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcutils/DoubleMatcher.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcutils/DoubleMatcher.java @@ -17,56 +17,55 @@ class DoubleMatcher { */ private static final String Exp = "[eE][+-]?" + Digits; - private static final String fpRegex = "[\\x00-\\x20]*" + // Optional - // leading - // "whitespace" - "[+-]?(" + // Optional sign character - "NaN|" + // "NaN" string - "Infinity|" + // "Infinity" string + private static final String fpRegex = + "[\\x00-\\x20]*" // Optional leading "whitespace" + + "[+-]?(" + // Optional sign character + "NaN|" + // "NaN" string + "Infinity|" + // "Infinity" string - /* - * A decimal floating-point string representing a finite - * positive number without a leading sign has at most - * five basic pieces: Digits . Digits ExponentPart - * FloatTypeSuffix - * - * Since this method allows integer-only strings as - * input in addition to strings of floating-point - * literals, the two sub-patterns below are - * simplifications of the grammar productions from - * section 3.10.2 of The Java™ Language Specification. - */ + /* + * A decimal floating-point string representing a finite + * positive number without a leading sign has at most + * five basic pieces: Digits . Digits ExponentPart + * FloatTypeSuffix + * + * Since this method allows integer-only strings as + * input in addition to strings of floating-point + * literals, the two sub-patterns below are + * simplifications of the grammar productions from + * section 3.10.2 of The Java™ Language Specification. + */ - /* - * Digits ._opt Digits_opt ExponentPart_opt - * FloatTypeSuffix_opt - */ - "(((" + Digits + "(\\.)?(" + Digits + "?)(" + Exp + ")?)|" + + /* + * Digits ._opt Digits_opt ExponentPart_opt + * FloatTypeSuffix_opt + */ + "(((" + Digits + "(\\.)?(" + Digits + "?)(" + Exp + ")?)|" + - /* - * . Digits ExponentPart_opt FloatTypeSuffix_opt - */ - "(\\.(" + Digits + ")(" + Exp + ")?)|" + + /* + * . Digits ExponentPart_opt FloatTypeSuffix_opt + */ + "(\\.(" + Digits + ")(" + Exp + ")?)|" + - /* - * Hexadecimal strings - */ - "((" + - /* - * 0[xX] HexDigits ._opt BinaryExponent - * FloatTypeSuffix_opt - */ - "(0[xX]" + HexDigits + "(\\.)?)|" + + /* + * Hexadecimal strings + */ + "((" + + /* + * 0[xX] HexDigits ._opt BinaryExponent + * FloatTypeSuffix_opt + */ + "(0[xX]" + HexDigits + "(\\.)?)|" + - /* - * 0[xX] HexDigits_opt . HexDigits BinaryExponent - * FloatTypeSuffix_opt - */ - "(0[xX]" + HexDigits + "?(\\.)" + HexDigits + ")" + + /* + * 0[xX] HexDigits_opt . HexDigits BinaryExponent + * FloatTypeSuffix_opt + */ + "(0[xX]" + HexDigits + "?(\\.)" + HexDigits + ")" + - ")[pP][+-]?" + Digits + "))" + "[fFdD]?))" + "[\\x00-\\x20]*"; // Optional - // trailing - // "whitespace" + ")[pP][+-]?" + Digits + "))" + "[fFdD]?))" + "[\\x00-\\x20]*"; // Optional + // trailing + // "whitespace" public static final Pattern floatingLiteral = Pattern.compile("\\A" + fpRegex + "\\Z"); } |
