When is a issue too complex for a regular expression?

后端 未结 13 1011
执念已碎
执念已碎 2021-02-01 19:42

Please don\'t answer the obvious, but what are the limit signs that tell us a problem should not be solved using regular expressions?

For example: Why is a complete emai

13条回答
  •  南笙
    南笙 (楼主)
    2021-02-01 20:34

    A problem is too complex for regular expressions when constraints of the problem can change after the solution is written. So, in your example, how can you be sure an email address is valid when you do not have access to the target mail system to verify that the email address is attached to a valid user? You can't.

提交回复
热议问题