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

exclude strings ending with 0000

  •  08-27-2009, 11:39 PM

    exclude strings ending with 0000

    I have to evaluate many 20 character strings.  How would I only allow a match for strings that do not end with four or more zeros?

    Basic alphanumeric strings.  

    Case doesn't matter.

     

    Given the following strings:

    00000000000234560000

    F0000000001234560R00

    000000000012d4500000

    00030000001234560200

    0000000000s234560000

    00000FF000324400000E

     

    The result would be

    00030000001234560200

    F0000000001234560R00

    00000FF000324400000E

     

    I was trying

    ^.+([^0]|[^0][0]|[^0][0][0]|[^0][0][0][0])$

    but it didn't seem to product expected results.

     

     

     Any help is most appreciated.

     

     

     

View Complete Thread