多词的正则表达式 [英] regular expression for multi-words

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

问题描述

我需要一个RegExp来匹配文本中的多个单词



RegExp,它与文本中的动词,名词,介词相匹配

I need a RegExp which matches multi-words in text

also

RegExp which matches verb,noun,preposition in text

推荐答案

直到我到达问题的最后一部分,我虽然很容易"-对于一个正则表达式".

但事实并非如此.正则表达式只与模式匹配有关,而不是与词法分析有关,这是准确匹配常规文本中的动词,名词,介词所需要的.

Google for 词法分析英语 [ ^ ] -但要为认真阅读做好准备!
Until I reached the last part of your question, I though "that''s easy - a perfect task for a Regex".

But it isn''t. Regex is all about pattern matching, not lexical analysis, which is what you need to accurately match verb, noun, preposition in normal text.

Google for Lexical Analysis English[^] instead - but be prepared for some fairly serious reading!


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

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