mardi 6 janvier 2015

Regex max length, ignore specific word combination

I've made this regex to check the max length of a string:



/^[\[\]\/\w\s.,:;!?€¥£¢$-]{0,250}$/


The user needs to add [link] link text [/link] to the string to add a link. In my regex I want to ignore these [link][/link] for the max length of 250 characters.


How should I do this?





Aucun commentaire:

Enregistrer un commentaire