I have a form with an input field in which I need to ensure that if a user enters an opening angular bracket there is also a matching closing one - ie <this is some text>ghsghgsh<this is some more>gshhsghsg. That is the number of opening brackets equals the number of closing.
Also I need to check that a closing one always follows an opening one, ie you don't get <hggshghdsg>jhjhj><<jhh>
I can program this obviously starting with a function to count the number of < brackets equals the number of closing >, but wondered if there is a more elegant way it can be done with regular expressions.
I have used regular expressions in the validation of other fields and the regular expression validator, but am by no means an expert and wondered if people could give me an opinion on whether it is possible, or am I just expecting too much - has anyone done anything similar and if so could they provide some pointers.
Thanks
Andy
Also I need to check that a closing one always follows an opening one, ie you don't get <hggshghdsg>jhjhj><<jhh>
I can program this obviously starting with a function to count the number of < brackets equals the number of closing >, but wondered if there is a more elegant way it can be done with regular expressions.
I have used regular expressions in the validation of other fields and the regular expression validator, but am by no means an expert and wondered if people could give me an opinion on whether it is possible, or am I just expecting too much - has anyone done anything similar and if so could they provide some pointers.
Thanks
Andy