帮助正则表达式 [英] Help with regular expressions

查看:83
本文介绍了帮助正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在网页上搜索建立完整文本。 RE存在一些问题。请帮忙。我是Python的新手,并以某种方式设法达到程序的这一点。

I am trying to search for a text ''BUILD COMPLETE'' on a web page. There is some problem with the RE. Please help. I am new to Python and somehow managed to reach to this point of the program.

展开 | 选择 | Wrap | 行号

推荐答案

我不知道为什么会搜索BUILD COMPLETE的数据。也许如果你有。* BUILD COMPLETE。*。但搜索也将返回匹配对象而不是TRUE或FALSE。


尝试 docs ,如果你没有运气回复。
I''m not sure why that would search the data for BUILD COMPLETE. Maybe if you had ".*BUILD COMPLETE.*". But the search will also return a match object rather than a TRUE or FALSE.

Try the docs, and if you don''t have any luck post back.


Hi Glenton,

虽然数据变量打印出了BUILD COMPLETE,但我仍然尝试输出作为Build Failed。

Hi Glenton,
I tried but it stills gives me output as Build Failed even though the data variable prints outs BUILD COMPLETE.

展开 | 选择 | 换行 | 行号


所以考虑一下,虽然我喜欢正则表达式,但我认为这是正确的更容易使用''in''关键字。

So thinking about it, much though I love regular expressions, I think it''s easier to use the ''in'' keyword.

展开 | 选择 | Wrap | 行号


这篇关于帮助正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆