|
|
|
|
|
by rnovak
3604 days ago
|
|
\D is a subset of \S, so the \S accomplishes nothing (said another way, there is no character that matches \D that doesn't also match \S). Secondly, there are very few intersecting character classes (sets) that I'm aware of, and in all cases, you could achieve the desired result more clearly in other ways. Said another way: "AND" would just make regexes even harder to understand/approach, and that is almost always undesirable. |
|
A more practical example might be something like
in order to only match strings where the content between the numeric codes matches both "crab" and "apple" in any order.To be clear, I don't know that it's useful enough to warrant inclusion in a regex engine. I'm just trying to provide a useful illustration.