あなたはこれを試すことがあります。
\[@[\w-]+(?!=)\]
説明:
"\[" & ' Match the character “[” literally
"@" & ' Match the character “@” literally
"[\w-]" & ' Match a single character present in the list below
' A “word character” (Unicode; any letter or ideograph, digit, connector punctuation)
' The literal character “-”
"+" & ' Between one and unlimited times, as many times as possible, giving back as needed (greedy)
"(?!" & ' Assert that it is impossible to match the regex below starting at this position (negative lookahead)
"=" & ' Match the character “=” literally
")" &
"\]" ' Match the character “]” literally
は、この情報がお役に立てば幸い!
あなたは何を試しましたか? – Sefe
\ [@(。*?)[^ = 2] \] – Sunil
単語 'foo'は定数ですか?また、番号「2」または任意の数だけ除外したいとしますか?私は "\ [@(。*?)\]" – Gurman