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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -