取消
显示结果 
搜索替代 
您的意思是: 

Exclude a phrase using Match Pattern

Good day all,

I need to take an array of arbitrary strings and match only those strings that do *not* contain a particular phrase ("AQL" in this case). I know it's possible to exclude single characters by using the tilde inside of brackest [~....], but is there some way to exclude entire phrases?

For example, "Am_AQL" should not match, but "AMQL" should match.

I'm starting to go crosseyed looking at this one, so any help would be appreciated!
0 项奖励
1 条消息(共 5 条)
3,180 次查看
Why not just search for "AQL" and call it a match if it doesn't find it (Offset past match = -1)?

See the attached LV 6.1 example.
0 项奖励
2 条消息(共 5 条)
3,180 次查看
Unfortunately, the pattern is generated in one code module and stored in a file. Later on, in a different code module, the pattern is applied to a set of strings. For all other cases that I have, the pattern is a standard match pattern.

Currently, the second code module only understands how to run a pattern match, not how to invert the results of a pattern match.

I was hoping to avoid having to integrate specialized code into my general search algorithm.
0 项奖励
3 条消息(共 5 条)
3,179 次查看
I don't see it as "specialized code". The example I posted has a switch which can be set to include or exclude strings which match. You can set the default to Include and wire it to Exclude as needed. Depending on the strings you search for, you could include one or more characters at the start of the search string to indicate Exclude. E.g., you might code your search algorithm so that "AQL" means include strings with AQL, but "!AQL" or "!=AQL" means Exclude them. See the updated example.
0 项奖励
4 条消息(共 5 条)
3,180 次查看
I understand what you are doing with it, I was just hoping to not have to modify code that is called between several existing systems. It's difficult to say what it might break.

My thanks for all of your efforts, they are appreciated!
0 项奖励
5 条消息(共 5 条)
3,180 次查看