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

Validating that a string contains only single instances of certain characters in any order

  •  02-26-2011, 8:32 AM

    Validating that a string contains only single instances of certain characters in any order

    I'm working in C# and need to validate an input string.  Valid strings can contain 0 to 1 instances of the following characters - T, R, B, and/or L and can contain no other characters.  The characters can appear in any order in the string.  None or all of the characters can be present (the string can be empty or have up to 4 characters in it).

    Valid strings would include TRBL T LBRT BR RL "null"

    Invalid strings would include trbl TABL TTRBL 0B

     

    Thanks for any suggestions you have!


View Complete Thread