I need to separate the items from a string into an array using C # and Regex, could they help me?
The string is as follows:
required|email|min:2|max:255
There are some rules I wanted to fit:
- Separate the main items delimited by the
|
toolbar. - Ignore if there is a slash at the end of the string, example
required|email|
. - Separate items that have a value, example
min:2
andmax:255
.