Simple Markup regex
Posted: Tue Nov 15, 2005 9:15 pm
So I have 3 patterns:
3 replacements:
That gaggle of nonsense is suposed to replace *some text which needs to be bolded* with <strong>some text that needs to be bolded</strong>, etc - without running across multiple lines.
*this is valid bold markup*
*this
isn't
valid*
Instead, it doesn't replace anything. What do I need to change?
Edit: I now realize the m modifier in there isn't what I want... I need some form of "not * and not line break" regex...
- Nathaniel
Code: Select all
array('/^\*([^*]+)\*$/ms',
'/^\_([^_]+)\_$/ms',
'/^\%([^\%]+)\%$/ms');Code: Select all
array('<strong>$1</strong>',
'<em>$1</em>',
'<small>$1</small>');*this is valid bold markup*
*this
isn't
valid*
Instead, it doesn't replace anything. What do I need to change?
Edit: I now realize the m modifier in there isn't what I want... I need some form of "not * and not line break" regex...
- Nathaniel