I guess this is because in the rule [/>] it matches either / or > .
Exactly.
But the question is how do i write that rule so that it matches / and > together?
"/>"
Am I not doing the same?
No. [/]
matches / and [>]
matches >. So [/][>]
would work. But the quoted form is more normal.