Saturday, 7 September 2013

how to detect keywords with regular expression

how to detect keywords with regular expression

I want to write a simple code highlighter in php for java. One of the
keywords is "class", and is replaced by class The problem is that the
class from the span is also marked as a keyword. So i need a regex that
says: "class",and after that not "=" it tried with /class[^=] but this is
totally bullshit. So, how can i create this but not this expressions?
Thank you!

No comments:

Post a Comment