JavaScript Regex needs to catch new lines

scare

New Member
So, I have:\[code\]/`{3}(?:(.*$)\n)?([\s\S]*)`{3}/m\[/code\]Which matches things like this fine:\[code\]```javascriptalert('Hello World');//It wont break even if i throw in ``` in this comment!```\[/code\]But unfortunately it also matches:\[code\]```javascriptalert('Hello World');``````javascriptalert('OH NOES!');```\[/code\]As one match, but it should be two. It should look for everything, including other ``` inside, but once it sees a double line break, it should start looking for another match.
 
Top