I try to extract the error number from strings like \"Wrong parameters - Error 1356\":
Pattern p = Pattern.compile(\"(\\\\d*)\");
Matcher m =
With the pattern /d+ at least one digit will need to be reached, and then the match will return all subsequent characters until a non-digit character is reached.
/d* will match all the empty strings (zero or more), as well at the match. The .Net Regex parser will return all these empty string groups in its set of matches.