我试图在下面的例子@@BOKeyword-
中匹配最里面的内容:-End@@
@@BOKeyword-Here is@@BOKeyword-I want to match this!-End@@stuff-End@@
所以我的比赛是:I want to match this!
我正在使用以下正则表达式:@@BOKeyword-([^@@BOKeyword--End@@]*)-End@@
但是,这根本不匹配。我基于这个例子开发了这个,这个例子是我从上一个问题的答案中得出的:
AC I want to match this! BD I don't want to match this! AC I want to match this! BD I don't want to match this! BD
使用正则表达式:AC([^ACBD]*)BD
这按预期工作。我想我误解了这是如何工作的。任何提示将不胜感激!谢谢!
注意:我在 Java 中运行它。