1 2 Previous Next 22 Replies Latest reply on Feb 23, 2008 4:28 AM by 800351

    how to check if there is any other character than "0" - regex?

      Hi Guys
      Simple if i have few strings eg "00000000000" or "000F0000000" or "a0000000"

      how do I find using regex, that whether the strings has any other value than 0 OR they all all 0s.

      i tried Pattern.compile("[^0]"); on above strings,
      Then I use pattern.matcher for above strings

      I expect false, true, true for above strings respectively? but it returns false for all of the strings

      please help.
        1 2 Previous Next