Hi folks, I'm trying to parse some Wiki style markup to generate some html but regex is not my strong point.
I'm trying to replace markup such as this:
into this:
The parser I'm using (Javascript Creole 1.0 Wiki Parser) uses regex to match all other markup so I'm trying to follow the same format using this expression:
Which doesn't quite do the job - it appears to be generating a div block for each "<<" instead of "<<blahblah<<"
Basically, I need the expression to match << followed by anything at all, until it hits the next <<
Anyone able to help?
I'm trying to replace markup such as this:
PHP:
<< content_here <<
into this:
PHP:
<div>content_here</div>
The parser I'm using (Javascript Creole 1.0 Wiki Parser) uses regex to match all other markup so I'm trying to follow the same format using this expression:
PHP:
/<<([^*~]*((<(?!<)|~(.|(?=\n)|$))[^*~]*)*)(<<|\n|$)/
Basically, I need the expression to match << followed by anything at all, until it hits the next <<
Anyone able to help?