regex - Find line with close curly bracket "}" but not with semicolon ";" or comma "," -
i trying find regex meet requirement. want match lines close curly bracket should not contain semicolon or comma. there maybe space or tab before bracket. there maybe space or other characters between bracket , semicolon/comma.
an example
match: [sapce/tab] } } /\* abcde \*/ } else { // abcde
ignore: }; } abc; },
this have manages far:
^\s*(?=}).*(?!;)\s\*$
but matches };
, } ,
among others not want. have tried
^\s*}[^;,][0-9a-za-z_/*\{]\s*$
ignores } abc; , } else {
this seems work me:
^[^,;]*\}[^,;]*$
Comments
Post a Comment