Long (@NotNull RegExpNumber number) { try { final long result = Long.parseLong(number.getUnescapedText()); if (result >= 0xFFFFFFFFL /* max unsigned int 32 bits */) return null; return result; } catch (NumberFormatException e) { return null; } }