I need to write a small regex which should match the occurrences of literal character * when it appears with any other special character. For example, I need to catch all of these occurrences !* )* (* ** *.*
. The exception to this is *=
and =*
, which I want to allow. I tried writing the regex as
\W&&[^=]\*|\*\W&&[^=]
but this doesn't seem to work. Any suggestions? Thanks much for the help.