正则表达式使用 [英] Regular expression use

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

问题描述



由于我不会解释的原因,因为它们太复杂了

并且不是非常相关,我有兴趣发现什么

人实际上使用正则表达式。不是主题

域名,而是正则表达式的构造。


我了解计算机科学家和解析,我知道

使用相对简单的东西,例如从网页中提取

HTML链接。但是我没有太多感觉

(可能很少但很难)使用更复杂的用于

其他目的。我听说过几种这样的用法,但是不要
总体上知道发生了什么。


任何指针都赞赏,更多 - 或者更少的东西。

问候,

Nick Maclaren。


For reasons that I won''t explain, as they are too complicated
and not terribly relevant, I am interested in discovering what
people actually use regular expressions for. Not the subject
domain, but the construction of the regular expressions.

I know about computer scientists and parsing, and I know about
the use of relatively simple ones for things like extracting
HTML links from Web pages. But I don''t have much feel for the
(probably rare but difficult) uses of more complex ones for
other purposes. I have heard of several such uses, but don''t
have an overall idea of what is going on.

Any pointers appreciated, to more-or-less anything.
Regards,
Nick Maclaren.

推荐答案

Nick Maclaren< ; nm ** @ cus.cam.ac.ukwrote在comp.lang.perl.misc中:
Nick Maclaren <nm**@cus.cam.ac.ukwrote in comp.lang.perl.misc:

>

原因是我不会解释,因为它们太复杂了

并且不是非常相关,
>
For reasons that I won''t explain, as they are too complicated
and not terribly relevant,



你的理由是你的动机读者回答这么广泛的问题。

Your reasons are relevant as a motivation for your readers to
answer such a broad question.


我有兴趣发现什么

人们实际上经常使用表达式。不是主题

域名,而是构造正则表达式。
I am interested in discovering what
people actually use regular expressions for. Not the subject
domain, but the construction of the regular expressions.



正则表达式的构造与它的用法有什么关系

for?这没有任何意义。

How is the construction of a regex related to what it is used
for? That makes no sense.


我了解计算机科学家和解析,
I know about computer scientists and parsing,



那是(广泛的主题领域。

That''s a (broad) subject domain.


我知道

使用相对简单的东西来提取

来自网页的HTML链接。
and I know about
the use of relatively simple ones for things like extracting
HTML links from Web pages.



这是另一个主题域(并且用于此目的的正则表达式不会是
符合相对简单的条件) 。

That''s another subject domain (and a regex for that purpose wouldn''t
qualify as "relatively simple").


但我不太喜欢

(可能是罕见但很难)使用更复杂的用于

其他用途。我听说过几种这样的用法,但是不要b $ b总体上知道发生了什么。
But I don''t have much feel for the
(probably rare but difficult) uses of more complex ones for
other purposes. I have heard of several such uses, but don''t
have an overall idea of what is going on.



你的问题是如此严格定义,需要付出相当大的努力

才能理解它。鉴于你的前提是别介意我需要它,只需给出信息,我甚至都不会尝试。


Anno

Your question is so badly defined, it would take considerable effort
just to make sense of it. Given your premise of "Never mind what I
need it for, just gimme the info," I won''t even try.

Anno


2007年8月24日10:58:46 GMT, nm ** @ cus.cam.ac.uk (Nick Maclaren)写道:
On 24 Aug 2007 10:58:46 GMT, nm**@cus.cam.ac.uk (Nick Maclaren) wrote:

>
由于我不会解释的原因,因为它们太复杂而且不是非常相关,我有兴趣发现人们实际使用正则表达式的内容。不是主题领域,而是正则表达式的构建。

我了解计算机科学家和解析,我知道使用相对简单的东西来做类似的事情从网页中提取HTML链接。但是我对其他目的的更复杂的用途(可能是罕见但很难)没有多少感觉。我听说过几种这样的用法,但是我们并不总是知道发生了什么。

任何指针都会受到赞赏,无论是或多或少的。



在链接项目中,正则表达式用于解析

通信协议响应,文件内容和interporocess

通信(至少)。


它们可能不是很优雅的解决方案,但这是我在python中制作的第一个

项目(还有正则表达式)! !


注意:我是作者,我发誓该应用程序没有病毒,

它已经完全用python和WingWare标准开发

安装,它只会存放一些文件

In the linked project, regular expression are used to parse
communication protocol responses, file contents, and interporocess
communcation (at least).

They may not be pretty elegant solutions, but this is the first
project I made in python (and also with regex)!!

NOTE: I am the author, and I swear the application is free of viruses,
it has been fully developed with a python and a WingWare standar
installation, and it will only deposit some files on your


python


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

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