且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在ActionScript中,如何匹配/在不定式结构要划掉/关?

更新时间:2023-02-15 19:17:08

我仍然不知道我理解的问题。你想匹配的东西,看起来像一个不定式动词短语,并包含完整的单词 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.