本文介绍了正则表达式使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 由于我不会解释的原因,因为它们太复杂了 并且不是非常相关,我有兴趣发现什么 人实际上使用正则表达式。不是主题 域名,而是正则表达式的构造。 我了解计算机科学家和解析,我知道 使用相对简单的东西,例如从网页中提取 HTML链接。但是我没有太多感觉 (可能很少但很难)使用更复杂的用于 其他目的。我听说过几种这样的用法,但是不要总体上知道发生了什么。 任何指针都赞赏,更多 - 或者更少的东西。 问候, Nick Maclaren。For reasons that I won''t explain, as they are too complicatedand not terribly relevant, I am interested in discovering whatpeople actually use regular expressions for. Not the subjectdomain, but the construction of the regular expressions.I know about computer scientists and parsing, and I know aboutthe use of relatively simple ones for things like extractingHTML links from Web pages. But I don''t have much feel for the(probably rare but difficult) uses of more complex ones forother purposes. I have heard of several such uses, but don''thave an overall idea of what is going on.Any pointers appreciated, to more-or-less anything.Regards,Nick Maclaren.推荐答案 你的理由是你的动机读者回答这么广泛的问题。Your reasons are relevant as a motivation for your readers toanswer such a broad question. 正则表达式的构造与它的用法有什么关系 for?这没有任何意义。How is the construction of a regex related to what it is usedfor? That makes no sense. 那是(广泛的主题领域。That''s a (broad) subject domain. 这是另一个主题域(并且用于此目的的正则表达式不会是符合相对简单的条件) 。That''s another subject domain (and a regex for that purpose wouldn''tqualify as "relatively simple"). 你的问题是如此严格定义,需要付出相当大的努力 才能理解它。鉴于你的前提是别介意我需要它,只需给出信息,我甚至都不会尝试。 AnnoYour question is so badly defined, it would take considerable effortjust to make sense of it. Given your premise of "Never mind what Ineed it for, just gimme the info," I won''t even try.Anno 在链接项目中,正则表达式用于解析 通信协议响应,文件内容和interporocess 通信(至少)。 它们可能不是很优雅的解决方案,但这是我在python中制作的第一个 项目(还有正则表达式)! ! 注意:我是作者,我发誓该应用程序没有病毒, 它已经完全用python和WingWare标准开发 安装,它只会存放一些文件In the linked project, regular expression are used to parsecommunication protocol responses, file contents, and interporocesscommuncation (at least).They may not be pretty elegant solutions, but this is the firstproject 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 standarinstallation, and it will only deposit some files on your 这篇关于正则表达式使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!