I need a regex to use in a C# App with the follow structure:
- domains separated by semicolon
Valid Example:
domain1.com;domain2.org;subdomain.domain.net
How can i do that with a single Regex?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Given my aversion to regex in general, I am compelled to post an alternative (banking on the fact that you’re going to need the individual domain representations as separate entities at some point anyway):
Where
delimitedDomainsis a string of domains in the format mentioned and the result being an array of each individual domain entry found.It may well be that there are more cases to your scenario than precisely detailed, however, if this is the extent of your goal and the input then this should suffice quite well.