阅读背景:

Python正则表达式 - 根据输入确定答案

来源:互联网 

I'm wondering if it is possible to use re in Python to find the answer to a question. For example the user is asked a question "Do you wish to continue?"; Can I use regular expressions so that 'y' 'Y' 'YES' 'yes' 'Yes' set a variable to 1, or 'n' 'N' 'No' 'NO' sets a variable to 0? I know that it is possible to do this without using regex, but I'm trying to increase my knowledge of using regular expressions.I'm wondering if it is possible to use re in Py




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: