TLDR: The question as written is neither particularly useful as a domain-specific nor as a domain-agnostic one. A minimum of research should have eliminated at least some of the problems already.
To get this out of the way first: Matching multiple things and escaping special things are very basic regex functionality. Both of these are covered in regex docs and, to stay within Stack Overflow, a simple web search turns up countless Q&A addressing those issues.
Just punching the title into a search engine and restricting it to Stack Overflow leads to the current duplicate target as well as several other Q&A that contain the desired regex pattern.
The real issue, though, is that the question is neither particularly useful as a reference for the domain problem nor the programming problem.
For anyone with a similar programming problem, the Q&A is practically unfindable. None of the core programming issues – matching multiple things and matching special things – is spelled out in searchable terms, neither in specific ("match slash") nor generically ("match special character").
Constructing a Minimal, Reproducible Example of the programming problem would help here. Remove the domain specific formulation and it should immediately reveal the above mentioned issues. It is prudent to focus on one issue at a time as well.
For anyone with a similar domain problem, the Q&A is of questionable value. It is only about your format that is neither clearly specified nor thorough. Is the separator directly adjacent or are spaces allowed? Do numbers have to make sense, as in are 000/0
or 9001/3
valid? Is the format suitable for text extraction, as in what would should not170/80pass
result in?
Constructing a Minimal, Reproducible Example of the domain problem would help here. Give a clear specification of what the required rules are, ideally referring to some actual standard as well, and provide thorough test cases.
\d{min,max}
How exactly do you justify that an infinite amount of questions all answered by this, are all distinct, and useful to keep in a knowledge repository?+
,*
,{min,max}
,?
. This is not very advanced, any introductory regex course will cover them in an hour or less. I do not see how asking for all and every variation of these basic concepts is useful to keeping around. We generally don't keep infinite amount of questions in the form "how do I make a loop that iterates X times" and then just re-ask it with a different value of X.