
November 24th, 2008, 01:12 AM
|
|
|
That is because character classes always match a single character.
So the class [^(\*/)] will match any character except '(', '*', '/' or ')'. As you see, the "normal" meta characters like '(' and ')' don't group characters inside a character class as they do outside a character class. Also, the '*' does not need escaping inside a character class and it just matches the character '*'.
All of that said, you can match comments like this:
Code:
(?s)/\*((?!\*/).)*\*/
Last edited by prometheuzz : November 24th, 2008 at 01:14 AM.
|