Validating domain objects
And not just slow, but the performance of the regex engine can be totally unpredictable when faced with arbitrary (user-supplied) inputs., for example) first compile the pattern to a DFA.Afterwards, the complexity of the pattern is largely irrelevant.These look much more like a grammatical declaration. Agreed, because a Reg Ex has to be a jack of all trades it's processing overhead is huge.Just because using a Reg Ex engine seems easy doesn't mean it's a better solution over an iterative parser (developer dependent threshold).This operation can only be performed on a leaf object.
Aggreed, Reg Ex's provide an easy tool to do some things but unless you need the full power of regular expressions they Lexical analysers may indeed use regexes.
From there find the user expand the object and remove it from there.
This would be a safer way to remove the leaf object. Remove the account from the phone and set it up again?
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.
I don't think people object to regular expressions because they're slow, but rather because they're hard to read and write, as well as tricky to get right.
This seriously improves readability and therefore maintainability.