在ActionScript中,如何匹配/在不定式结构要划掉/关? [英] In Actionscript, how to match / in infinitive structures like to cross out/off?
问题描述
我用下面的正前pression找到确切的事件的不定式。标志是全球性的。
I'm using the following regular expression to find the exact occurrences in infinitives. Flag is global.
(?!to )(?<!\w) (' + word_to_search + ') (?!\w)
要给予什么的例子我想实现
To give example of what I'm trying to achieve
- 找出来不应该带:取缔
- 寻找出能够带来:是脱节
- 找不应该携带:要等,只是因为它匹配的第一个以
我已经做了这些步骤,但是,划掉/关应该是在结果列表中了。有什么办法不影响什么,我已经实现创建例外?
I've already done these steps, however, to cross out/off should be in the result list too. Is there any way to create an exception without compromising what I have achieved?
感谢你。
推荐答案
我仍然不知道我理解的问题。你想匹配的东西,看起来像一个不定式动词短语,并包含完整的单词 word_to_search
?试试这个:
I'm still not sure I understand the question. You want to match something that looks like an infinitive verb phrase and contains the whole word word_to_search
? Try this:
"\\bto\\s(?:\\w+[\\s/])*" + word_to_search + "\\b"
记住,当你在一个字符串的形式创造一个正则表达式,你必须逃离反斜杠。如果您尝试使用\ b按钮指定一个字边界,它会一直PTED为空格间$ P $。
Remember, when you create a regex in the form of a string literal, you have to escape the backslashes. If you tried to use "\b" to specify a word boundary, it would have been interpreted as a backspace.
这篇关于在ActionScript中,如何匹配/在不定式结构要划掉/关?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!