1 2 Previous Next 22 Replies Latest reply: Feb 22, 2008 10:28 PM by 800351 RSS

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

    807603
      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.
      thanks
        1 2 Previous Next