Search Results

Search found 2 results on 1 pages for 'user268375'.

Page 1/1 | 1 

  • Regular expression help

    - by user268375
    I need a regular expression for which: the string is alphanumeric and have exactly 6 characters in the first half followed by hyphen(optional) followed by optional 4 characters:(cannot have more than 4 characters in the second half) so any of the following is valid 11111A 111111-1 111111-yy yyyyy-989 yyyyyy-9090 I have ^[a-zA-Z0-9]{5}(-[a-zA-Z0-9]{1,3})?$ as the regex expression what if i want to add another condition stating that the first half cannot have all zeros and also the whole expression cannot have zeros so 00000 or 00000-000 is invalid

    Read the article

  • help with regex needed

    - by user268375
    I need a regular expression with the following needs: the string is alphanumeric and have exactly 6 characters in the first half followed by hyphen(optional) followed by optional 4 characters:(cannot have more than 4 characters in the second half) so any of the following is valid 11111A 111111-1 111111-yy yyyyy-989 yyyyyy-9090 i thought this expression /[a-zA-Z0-9]([-])?[a-zA-Z0-9]{5,10}$/; should work but i m unable to get it working correctly. Any help will be appreciated,

    Read the article

1