こういうこと?

[Patterns]
Name = "new filter"
Active = FALSE
Limit = 2560
Match = "<p>((((^</p>)?)++)\#@\1\s$SET(\#=<a href="https://twitter.com/\1">@\1</a> ))+(*)\#</p>"
Replace = "<p>\@</p>"