Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Browse by Tags

All Tags » regex JavaScript Java
Sorry, but there are no more tags available to filter with.
  • Empty groups in JavaScript

    I have this regular expression that evaluate differently in JavaScript versus Java: var r = new RegExp("^|([0-9][0-9])$", "") The intent is to accept an string or a 2-digit string. However the call r.test("abc") returns true ! In Java, the equivalent code, Pattern.matches("^|([0-9][0-9])$", ...
    Posted to Platform Differences (Forum) by agilbert on April 3, 2008