6 Replies Latest reply: Oct 15, 2010 5:39 AM by biene22 RSS

    validate cfinput using regular expression

    biene22

      Hi,

       

      can somebody help me valditing an cfinput field using regular expressions?

       

       

      First digit must be a number or "R".

      Digit 2-15 can be everything without special characters. Digit 2-15 can also be empty.

       

      I try this, but it doesn't work (Sorry I'm a beginner using regex).

       

      <cfinput type="text" name="field1" required="yes" validate="regular_expression"  pattern="[0-9Rr][0-9a-zA-Z]*"  maxlength="15">

       

      Thank you in advice!

       

      Claudia