Seamless Solutions, Tailored Integration info@wkintegrations.com Kendal, Cumbria, UK

Tag

regular expressions

4 posts tagged “regular expressions”.

Multiline TextBox Maximum Character Validation

Maximum character validation on asp.net TextBox controls do not work, therefore a RegularExpressionValidator has to be used to make sure the maximum number of characters are not exceeded e.g. <asp:TextBox…

Examples of Regular Expressions

Trim string in JavaScript var trimre='^s+|s+$'; // replace whitespace var trimmedstring = string.replace(trimre,""); Check for a valid date format in JavaScript var re='^(d{1,2})/(d{1,2})/(d{4})$'; // dd/mm/yyyy if (!datestring.match(re)) { alert("Date" +…

Creating a Banned Words Filter

I have a website with a user forum and content management system, where certain users (or anyone in the case of forums) can post to. I therefore had to create…