House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / Regular Expressions (RegEx)

regex for twitter style URL

Author:
Peter Boughton
07/04/2009 10:35 PM

Try this: ^(?!user|index\.cfm)([\w-]+)$ Note that this allows only usernames containing alphanumeric, underscore, and/or hyphen. If usernames allow more characters, or you want to defer validation to the script, you could use something more inclusive (e.g ".+") instead of "[\w-]+", for that part of the expression. Oh and not too sure what the "user" part there is for, but it may need updating if you don't want to block names such as "useredpaint" and similar.


Search regex

February 11, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29