如何检查字符串是否包含python中带有未知字符的子字符串?
抱歉,如果标题不描述,我很不擅长总结。
我想检查字符串是否包含带有未知字符的子字符串。
例如,如果我有一个像“ foobar”之类的字符串,我想检查它是否具有“ oo?ar”或“ ooba”之类的东西?
Sorry if the title is undescriptive, I'm bad at summarizing.
I want to check if a string includes a substring with an unknown character.
For example, if I have a string like "foobar", I want to check if it has something like "oo?ar" or "ooba?", signifying that a character is there, just that it can be any character.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
re.findall
返回一个ROGEX(docs.python.org/3/howto/regex.html)模式的所有匹配列表。 REGEX字符。
匹配任何字符,但不匹配新线。re.findall
returns a list of all matches of a regex (docs.python.org/3/howto/regex.html) pattern in a string. The regex character.
matches any character, but not a newline.