CFINPUT Reg Expression Validation Pattern Help

I've got a form with a non-required field that needs to meet
some validation requirements (Numbers, Letters, 'space character'
or 'blank, empty string' only) if the user chooses to fill it
out...
I'm using CFINPUT tag with the following settings, does my
Reg Expression pattern look OK?
REQUIRED="No"
VALIDATE="regular_expression"
PATTERN="^[a-zA-Z *]{1,40}$"
MAXLENGTH="40"
Thanks for any help. I'm v. new to regular expressions (10
hrs education at Google Univ.)
Sincerely,
Paul Cross

I think you want something more like this:
^[a-zA-Z0-9 ]{0,40}$

Similar Messages

  • Reg expression help

    Can/will you help me make a regular expression for these characters? I want to replace eveyone occurance in a string contianing these chars
    \/:*"<>|
    with
    right now I am doing a string.replaceAll(...) on each char but I was wanting to combine that to one reg expression. What cha got? I am doing this b/c I am generating file names and those are not valid chars allowed in file names.
    Thanks
    Doopterus

      String regex = "[*<>/'\"\\\\]";In a character class (i.e., between the square brackets), "|" has no special meaning.

  • Inline display of error message for a regular expression validation

    Hi All,
    I am using ApexLib in my application.
    I am using regular expression validation for some of the items.
    Those validation will happen when the button is pressed and the message will be displayed as per the error.
    But, I want the errors to be displayed immediately when the focus is away from that item.
    as we do for required items.
    could anybody help me to achieve it?
    Thanks in advance
    bye
    Srikavi

    Hi Srikavi,
    to achieve a Validation of an item when leaving the field you'll have to use some javascript code (as ApexLib does internally).
    What do you need:
    - onChange - Event on your Item
    - some Javascript code which is called in the onChange Event (you can put this code either in your page html header or, if it is used more often in your application, in a seperate js File)
    - call the ApexLib method apexlib.error.showError to display your error
    I actually never tried it myself, but i'm pretty sure that this will work (according to what i've seen in the ApexLib code).
    Have fun and tell us how it went,
    Peter
    Edited by: peter_raganitsch on Sep 5, 2008 11:56 AM

  • Programatically setting KM property Document Validity Pattern, no method

    I am trying to programatically set the attribute Document Validity Patterns of a KM property.  I am not able to find a method that achieves this.  I can read the Document Validity Pattern, but not set it.
    Can someone help?  My code is shown below:
    IPropertyConfigurationService propConfigService =
                        (IPropertyConfigurationService) ResourceFactory
                             .getInstance()
                             .getServiceFactory()
                             .getService("PropertyConfigurationService");
                   IMetaModel metaModel = propConfigService.getMetaModel();
                   IMetaNameListIterator iterator = metaModel.nameIterator();
                   while (iterator.hasNext()) {
                        IMetaName metaName = iterator.next();
                        String name = metaName.getName();
                        String namespace = metaName.getNamespace();
                        if (namespace.equals(filter)) {
                             String[] documentValidityPatterns =
                                  metaName.getDocumentPatterns();
                             //!!what, no method to set document validity pattern??!!               

    InDesign CS4 (6.0) Object Model says:
     The pattern of dashes and gaps, in the format [dash length1, gap length1, dash length2, gap length2]. Define up to ten values.
    That was it. I guess this is a place where the visual interface diverges from the javascript interface. I was expecting "Start" "Length" as in the dialog. Thanks!

  • Expressions and pattern matchers

    I want to parse some string using reg expressions, but I want to specify a start string -- any characters -- end string. I want it to stop the first time it finds the end string not the last time it finds it.
    Here is my code
    public static void main(String[] args) {
    String text = " a this is the first group b a this is the second group b xxxxxxx b";
    String oldHeader2 = "a.*b"; // I want the search to stop after the first b
    Pattern pattern = Pattern.compile(oldHeader2 );
    Matcher matcher = pattern.matcher(text);
    while (matcher.find()) {
    System.out.println("----");
    // Get the matching string
    String match = matcher.group();
    System.out.println(match);
    My output is this
    a this is the first group b a this is the second group b xxxxxxx b
    I need to get this out like this
    a this is the first group b
    a this is the second group b

    cjgoode wrote:
    I want to parse some string using reg expressions, but I want to specify a start string -- any characters -- end string. I want it to stop the first time it finds the end string not the last time it finds it.
    public static void main(String[] args) {
    String text = " a this is the first group b a this is the second group b xxxxxxx b";
    String oldHeader2 = "a.*b";  // I want the search to stop after the first b
    Pattern pattern = Pattern.compile(oldHeader2 );
    Matcher matcher = pattern.matcher(text);
    while (matcher.find()) {
    System.out.println("----");
    // Get the matching string
    String match = matcher.group();
    System.out.println(match);
    You are using a greedy quantifier but you want a reluctant quantifier.
      http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#sum

  • Clear/empty entry of field after validation pattern message

    Can anyone help me please with the following:
    Now when user fills a field a validation pattern message shows when entry is not according to validation. BUT...the entry remains.
    Do you know how to remove the entry from the field after clicking OK on the validation pattern message box?

    I don't know how to do that, but I think it would be user abuse to clear out the field. If I mistype a date or an SSN for example, I don't want to have to type it all over again, just correct my mistake.
    Jared

  • Validation pattern for 4 digit number

    Hi all,
    very simple requirement but I find no solution: Only 4-digit numbers (e.g. 2344 or 2345) should be allowed in a numeric field.
    I try to solve this with a validation pattern. My favorite pattern is "num{9999}". But this pattern validates also 1-, 2- or 3-digit numbers positive. Why? And what is the right pattern?
    Thanks in advance,
    Michael

    I'd make it per skript
    VALIDATION - JAVA SCRIPT
    if (this.rawValue > "999")
    true;
    } else {
    false;
    Limit it to 4 digits (like you've done already) and everything should work fine ^^
    Edit: Probably you should make the field obligatory too (at least if it should be obligatory).
    Hope that helped ^^
    Lisa ^^

  • Date Validation Script Help

    Hello
    I am creating a travel form on adobe designer 7.0 for employees to fill out before they go on vacation.  So i wrote a script that makes sure the the date entered for DateFrom is >= the current date and the DateTo is >= DateFrom.  I have been told to make the date format MM/DD/YY but for some reason the script only works when the format is MM/DD/YYYY.
    Here is my script For DateFrom:
    if (Date() < Date2Num($.formattedValue, "MM/DD/YYYY"))
    then
    xfa.host.setFocus("xfa.form.form1.DateTo")
    else
    xfa.host.setFocus("xfa.form.form1.DateFrom")
    xfa.host.messageBox("Your requested date can NOT come before the current date","Warning.",1)
    endif
    and the script for DateTo:
    if (Date2Num($.formattedValue, "MM/DD/YYYY") >= Date2Num(xfa.form.form1.DateFrom.formattedValue, "MM/DD/YYYY"))
    then
    xfa.host.setFocus("xfa.form.form1.enterC")
    else
    xfa.host.messageBox("The 'TO' Date must come after the 'FROM' Date", "TO DATE ERROR")
    xfa.host.setFocus("xfa.form.form1.DateTo")
    endif
    enterC is the next focus object after DateTo
    I have tried the obvious by switching the formattedValue to "MM/DD/YY" but with no success.  I have also tried switching the Display Pattern, Validation Pattern, and the Data Pattern to "MM/DD/YY" but nothing seems to work.  Does anyone know how to make this work with MM/DD/YY?
    Thanks in advance for any help
    Nick

    Irrespective of the display pattern/format I would use the following FormCalc code in your situation. Also check the attachment.
    'exit' event of the DateFrom:
    if (Date() <= Date2Num($.rawValue, "YYYY-MM-DD")) then
    //xfa.host.setFocus("xfa.form.form1.DateTo")
    var v1
    v1=1
    else
    xfa.host.setFocus("xfa.form.form1.DateFrom")
    xfa.host.messageBox("Your requested date can NOT come before the current date","Warning.",1)
    endif
    'exit' event of the DateTo
    if (Date2Num($.rawValue, "YYYY-MM-DD") > Date2Num(xfa.form.form1.DateFrom.rawValue, "YYYY-MM-DD")) then
    //xfa.host.setFocus("xfa.form.form1.enterC")
    var v1
    v1 =1
    else
    xfa.host.messageBox("The 'TO' Date must come after the 'FROM' Date", "TO DATE ERROR")
    xfa.host.setFocus("xfa.form.form1.DateTo")
    endif

  • How to validate a email address using Validation Pattern?

    Hi,
    is there any document for Validation Pattern? i m looking for a way to validate email addresses in my form.
    it's going to be something like * @ .
    i have no idea of how to do this, or maybe validation pattern is no good? use java script instead?
    any advice is appreciated!
    thanks.

    Hi erv2,
    You just need to place this script in the "exit" event of the field that u r using for email address.
    var r = new RegExp(); // Create a new Regular Expression Object.
        r.compile("^[a-z0-9_\\-\\.]+\\@[a-z0-9_\\-\\.]+\\.[a-z]{2,3}$","i");
    if( this.rawValue == null || this.rawValue == "")
    else
    var result = r.test(this.rawValue);                                              
    if (result == true) // If it fits the general form,
         true;               
    else
          xfa.host.messageBox("Please enter a valid email address ");
          this.rawValue = "";
          false;               // fail the validation.
    Thanks
    Amita
    Edited by: amita arora on Jan 20, 2009 10:44 AM

  • Expression validation error

    While trying to validate expression in mapping error window popups:
    "java.lang.Exception: ValidationError??
    java.lang.Exception: API8532: Internal Error: Language Validation can't create a unique type name when attempting to deploy a validation package."
    OWB creates "owb\bin\admin\..0" file, in which there are such entries:
    Wed May 21 08:14:40 CEST 2003
    Executing SQL for Expression Validation:
    CREATE TYPE "INGRP1_T_0";
    Wed May 21 08:14:40 CEST 2003
    Executing SQL for Expression Validation:
    CREATE TYPE "INGRP1_T_1";
    Wed May 21 08:14:40 CEST 2003
    Executing SQL for Expression Validation:
    CREATE TYPE "INGRP1_T_2";
    and so on up to :
    "Executing SQL for Expression Validation:
    CREATE TYPE "INGRP1_T_50";
    Wed May 21 08:14:42 CEST 2003
    java.lang.Exception: ValidationError??
    java.lang.Exception: API8532: Internal Error: Language Validation can't create a unique type name when attempting to deploy a validation package.
    "owb\bin\admin\ValidationPLSQL.log" file contains these 51 commands with increasing number:
    CREATE TYPE "INGRP1_T_0";
    It doesn't matter what expression I define.
    OWB is 9.0.4, Database EE 9.0.2
    What can it be ?

    Problem is it is already set to English_United States, I work only on this locale as to avoid such situations. MLS Disp. Lang. is American English.
    NLS settings in database and local regional settings in client system are only different (local).
    I tried validation at home, on different repository and it worked. Both databases are EE 9.2.0.1, the only real difference is server platform (Win XP there vs Linux).
    From what I can see right now there are way too many problems with OWB and locales, will it be fixed in the upcoming release ?
    Regards,
    Piotr

  • Eclipse XQuery expression validation failed: The current configuration is out of sync with the XQuery resource in the repository.

    I created a wsdl based on a dbadapter in jdeveloper, imported into eclipse and created the biz and the proxy and uploaded to oracle service bus, it works fine,
    but happens now that i need to have a xsd and wsdl with business names and not table names, invented to create a xsd and wsdl file in jdeveloper
    and then went to eclipse and tried t xquery tranformation, but when i add the replace in the message flow in the filed in Variable : body and Expression i look for the xquery and in the binding trying to put
    $body/input parameter, get the following error [RouteNode1, Replace action] XQuery expression validation failed: The current configuration is out of sync with the XQuery resource in the repository.
    what im doing wrong or its configuration
    thanks in advance sonia

    thanks
    ok have created a table with only in column varchar2(1)
    then the type object and the procedure to insert it works the proxy in the osb if i test it inserts
    now in jdeveloper i created an xml file with
    <?xml version="1.0" encoding="windows-1252" ?>
    <vessel>
    <barco>a</barco>
    </vessel>
    then i created a xsd based on this xml, and a wsdl based on the xsd
    in eclipse created a xquery transformation and selected source as the xsd created in adf and target the xsd input parameter, dont know why in the purple ball of the input parameter it puts a ?, an a f.
    then in the proxy xpath not writing anything in variable body and in the expression select the xquery and in binding select the parameter

  • Problems with date validation pattern DD.MM.YYYY in Form Builder

    (I am using LiveCycle Designer 8.0.)
    My form uses an input date field which consistst of DD.MM.YYYY.
    Display pattern, edit pattern, validation pattern and date pattern has been set to DD.MM.YYYY.
    "Validation Pattern Message"-box has been set to checked.
    "Validation Script Message"-box is not checked.
    1. When I type:      313101
    the system converts the digits to the date 01.01.3131
    2. When I type:      3131
    the system converts the digits to the date 01.01.3131
    3. When I type:       31   
    I get an error message "Date is not valid."
    I need a form to throw an error message if the user doesn`t type the correct input
    DD.MM.YYYY.  (01.03.2009)
    Thanks in advance.
    Tor

    Does anyone have any input on this matter?
    Thanks in advance.
    Regards,
    Tor

  • Validation Pattern Message

    I want to script a Validation Error Message for a field that, on initialize, is in read-only mode. In Designer, when Type = "Read Only" the Validation Pattern and Validation Pattern Message are disabled. I can add script to define the pattern:
    Myfield.validate.picture = "text{99999-9999}|text{99999}";
    and trigger the validation:
    Myfield.validate.formatTest = "error";
    but how can I script the error message that the user sees? Doing the above generates a generic message "Myfield validation failed" but I would like the user to see a more description message, for example "Please enter a 5 digit or 5+4 digit zip code in the format 12345 or 12345-6789".
    It seems silly that I add this field property at design time for a field that is NOT read-only, but not for one that toggles on/off from read-only to enabled. Any suggestions?

    Hi
    You can use the following:
    tfPostalCode.validate.picture.value = "9999";
    tfPostalCode.validate.message.formatTest.value = "An Australian Post Code must be a four digit number!";
    Howard

  • Creating Validation Pattern Message (like Designer) in Prof 8

    We aere using Prof 8, and would like to create a Validation Pattern message (with error box checked) similar to a val pattern message created in LC Designer. Is there any way to do it?
    KPanthen, Albany, NY

    Hi
    You can use the following:
    tfPostalCode.validate.picture.value = "9999";
    tfPostalCode.validate.message.formatTest.value = "An Australian Post Code must be a four digit number!";
    Howard

  • How to install or attach or add the plugins '.mnu and .vlx' to autocad 2012 or 2013 (mac version). In windows, its 'menuload' and express tools, that helps for it. But this command doesn't exist in mac version. so is there any other command or solution?

    How to install or attach or add the plugins '.mnu and .vlx' to autocad 2012 or 2013 (mac version). In windows, its 'menuload' and express tools, that helps for it. But this command doesn't exist in mac version. so is there any other command or solution?

    Please see autocad support at autodesk.com
    http://docs.autodesk.com/ACD/2014/ENU/index.html?url=files/GUID-5E50A846-C80B-4F FD-8DD3-C20B22098008.htm,topicNumber=d30e484012

Maybe you are looking for