Regex match semicolon but not in comments or quotes

Colton Rivera

New Member
I want to use a regex test to return all the matched semicolons, but only if they're outside of quotes (nested quotes), and not commented code.\[code\]testfunc();testfunc2("test;test");testfunc3("test';test");testfunc4('test";test');//testfunc5();/* testfunc6(); *//* testfunc7();*//* //testfunc8();*/testfunc9("test\"test");\[/code\]Only the semicolons on the end of each example should be returned by the regex string.I've been playing around with the below, but it fails on example testfunc3 and testfun9. It also doesn't ignore comments...\[code\]/;(?=(?:(?:[^"']*+["']){2})*+[^"']*+\z)/g\[/code\]Any help would be appreciated!
 
Back
Top