Help with Regular Expression for field validation

I'm fairly new to using regular expressions and using Acrobat. This is probably a simple question, but I've been unable to figure it out.
I have a text field on a PDF that I would like to be 9 characters in length. The first 2 characters can only be alphanumeric, the last 7 characters can only be numeric.
At first I was using the following, which allows all the characters to be alphanumeric:
var re = /^[A-Za-z0-9 :\\_]$/;
if (event.change.length >0) {
if (event.willCommit == false) {
    if (!re.test(event.change)) {
        event.rc = false
That works fine, but it's not quite what I needed. With some assistance I changed it (see below) to fit what I was looking for. However, this didn't work; it prevents anything from being entered in the field:
var re = /^[A-Za-z0-9]{2}\d{7}$/;
if (event.change.length >0) {
if (event.willCommit == false) {
    if (!re.test(event.change)) {
        event.rc = false
Any help would be greatly appreciated.
Thanks...

Here's a function you can call form the field's custom Format script. It should be placed in a document-level JavaScript:
function custom_ks1() {
    // Define non-commited regular expression
    var re = /^[A-Za-z0-9]{0,2}([0-9]{0,7})?$/;
    // Get all of the characters the user has entered
    var value = AFMergeChange(event);
    // Allow field to be cleared
    if(!value) return;
    if (event.willCommit) {
        // Define commited regular expression
        var re = /^[A-Za-z0-9]{2}[0-9]{7}$/;
        if (!re.test(value)) {  // If final value doesn't match, alert user
            app.alert("Your error message goes here.");
            // event.rc = false
    } else {  // not commited
        // Only allow characters that match the regular expression
        event.rc = re.test(value);
Call it like this:
// Custom Keystroke script
custom1_ks();

Similar Messages

  • Help With Regular Expression In Apex Validation

    Apex 3.2
    There is a validation type of regular expression in apex, but I have never used regular expression before,
    so a little help is appreciated.
    I need to validate a field. It is only allowed to contain alpha characers, numbers, spaces and the - (dash) character.
    I have tried several times to get this working
    eg
    [[:alpha:]]*[[:digit:]]*[[:space:]]*[-]*
    ^[[:alpha:][:digit:][:space:]-]+?
    and others, but just can't to get the syntax correct.
    Can someone help me with this please
    Gus

    Example:
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select 'This is some example text' as txt from dual union all
      2             select 'And this is the 2nd one with numbers' from dual union all
      3             select 'And this allows double-barrelled words with hyphens' from dual union all
      4             select 'But this one shouldn''t be allowed!' from dual
      5            )
      6  --
      7  select *
      8  from t
      9* where regexp_like(txt, '^[[:alnum:] -]*$')
    SQL> /
    TXT
    This is some example text
    And this is the 2nd one with numbers
    And this allows double-barrelled words with hyphens

  • Need help with regular expression

    I'm trying to use the java.util.regex package to extract URLs from html files.
    The URLs that I am interested in extracting from the HTML look like the following:
    <font color="#008000">http://forum.java.sun.com -
    So, the URL is always preceeded by:
    <font color="#008000">
    and then followed by a space character and then a hyphen character. I want to be able to put all these URLs in a Vector object. This doesn't seem like it should be too difficult but for some reason I can't get anywhere with it. Any help would be greatly appreciated. Thanks!

    hi gupta am not sure of the java syntax but i can tell u about the regular expression...try this....
    <font color="#008000">(http:\/\/[a-zA-Z0-9.]+) [-]
    i dont know the java methods to call...just the reg exp...
    Sanjay Acharya

  • Help with Regular Expressions and regexp_replace

    Oh great Oracle Guru can I can gets some help
    I need to clean up the phone numbers that have been entered in Oracle eBusiness per_phones table. Some of the phone numbers have dashes, some have spaces and some have char. I would just like to take all the digits out and then re-format the number.
    Ex.
    914-123-1234 .. output (914) 123-1234
    9141231234 ..again (914) 123-1234
    914 123 1234 .. (914) 123-1234
    myphone ... just null
    (914)-123-1234.. (914) 123-1234
    I really tried to understand the regular expressions statments, but for some reason I just can't understand it.

    Hi,
    Welcome to the forum!
    I would create a user-defined function for this. I expect there will be a lot of exceptions to the regular rules (for example, strings that do not contain exactly 10 digits, such as '1-800-987-6543') that can be handled, but would require lots of nested fucntions and othwer complicted code if you had to do it in a single statement.
    If you really want to do it with a regular expression:
    SELECT     phone_txt
    ,     REGEXP_REPLACE ( phone_txt
                     , '^\D*'          || -- 0 or more non-digits at the beginning of the string
                           '(\d\d\d)'     || -- \1 = 3 consecutive digits
                    '\D*'          || -- 0 or more non-digits
                           '(\d\d\d)'     || -- \2 = 3 consecutive digits
                    '\D*'          || -- 0 or more non-digits
                           '(\d\d\d)'     || -- \3 = 4 consecutive digits
                    '\D*$'             -- 0 or more non-digits at the end of the string
                     , '(\1) \2-\3'
                     )          AS new_phone_txt
    FROM    table_x
    ;

  • Help with regular expression needed

    Hi,
    Perhaps someone here can help me with my regular expression I'm trying to build in my Java code.
    The regular expression that I'm looking to build consists of any non-whitespace character up until it finds one or two <>= symbols and then any character thereafter. So both these Strings would match the expression:
    City 1==London
    Age>=18
    The regular expression that I'm using is as follows:
    (\\S+)([><=]){1,2}(.+)However, group 1 always retrieves the first <>= symbol as in "City 1=". How can I make the <>= part greedy so that it retrieves both operator symbols?
    Thanks.

    Make the first group, the non-spaces, reluctant:
    "(\\S+?)([<>=]{1,2})(.+)"

  • Help with regular expression to find a pattern in clob

    can someone help me writing a regular expression to query a clob that containts xml type data?
    query to find multiple occurrences of a variable string (i.e <EMPID-XX> - XX can be any number). If <EMPID-01> appears twice in the clob i want the result as EMPID-01,2 and if EMPID-02 appears 4 times i want the result as EMPID-02,4.

    with
    ofx_clob as
    (select q'~
    <EMPID>1
    < UNQID>123456
    < TIMESTAMP>...
    < ADDRINFO>
    < TITLE>^@~*
    < FIRST>ABCD
    < MI>
    < LAST>EFGH
    < ADDR1>ADDR1
    < ADDR2>^@~*
    < CITY>CITY
    <EMPID>2
    < UNQID>123457
    < TIMESTAMP>...
    < ADDRINFO>
    < TITLE>^@~*
    < FIRST>ABCD
    < MI>
    < LAST>EFGH
    < ADDR1>ADDR1
    < ADDR2>^@~*
    < CITY>CITY
    <EMPID>1
    < UNQID>123458
    < TIMESTAMP>...
    < ADDRINFO>
    < TITLE>^@~*
    < FIRST>ABCD
    < MI>
    < LAST>EFGH
    < ADDR1>ADDR1
    < ADDR2>^@~*
    < CITY>CITY
    ~' ofx from dual
    select '<EMPID>' || to_char(ids) || '(' || to_char(count(*)) || ')' multi_empid
      from (select replace(regexp_substr(ofx,'<EMPID>\d*',1,level),'<EMPID>') ids
              from ofx_clob
            connect by level <= regexp_count(ofx,'<EMPID>')
    group by ids having count(*) > 1
    MULTI_EMPID
    <EMPID>1(2)
    with
    ofx_clob as
    (select q'~
    <EMPID>1
    < UNQID>123456
    < TIMESTAMP>...
    < ADDRINFO>
    < TITLE>^@~*
    < FIRST>ABCD
    < MI>
    < LAST>EFGH
    < ADDR1>ADDR1
    < ADDR2>^@~*
    < CITY>CITY
    <EMPID>2
    < UNQID>123457
    < TIMESTAMP>...
    < ADDRINFO>
    < TITLE>^@~*
    < FIRST>ABCD
    < MI>
    < LAST>EFGH
    < ADDR1>ADDR1
    < ADDR2>^@~*
    < CITY>CITY
    <EMPID>1
    < UNQID>123456
    < TIMESTAMP>...
    < ADDRINFO>
    < TITLE>^@~*
    < FIRST>ABCD
    < MI>
    < LAST>EFGH
    < ADDR1>ADDR1
    < ADDR2>^@~*
    < CITY>CITY
    <EMPID>2
    < UNQID>123456
    < TIMESTAMP>...
    < ADDRINFO>
    < TITLE>^@~*
    < FIRST>ABCD
    < MI>
    < LAST>EFGH
    < ADDR1>ADDR1
    < ADDR2>^@~*
    < CITY>CITY
    <EMPID>1
    < UNQID>123458
    < TIMESTAMP>...
    < ADDRINFO>
    < TITLE>^@~*
    < FIRST>ABCD
    < MI>
    < LAST>EFGH
    < ADDR1>ADDR1
    < ADDR2>^@~*
    < CITY>CITY
    ~' ofx from dual
    select '<EMPID>' || listagg(to_char(ids) || '(' || to_char(count(*)) || ')',',') within group (order by ids) multi_empid
      from (select replace(regexp_substr(ofx,'<EMPID>\d*',1,level),'<EMPID>') ids
              from ofx_clob
            connect by level <= regexp_count(ofx,'<EMPID>')
    group by ids having count(*) > 1
    MULTI_EMPID
    <EMPID>1(3),2(2)
    Regards
    Etbin
    Message was edited by: Etbin
    used listagg to report more than one multiple <EMPID>

  • Help with Regular Expressions

    I have some sample code for string editing using regular expressions but I'm a little confused as to it's behavior. Here's what I have:
    public class WordFixer
        protected final String PUNC_MATCH = "[\\d\\p{Punct}]+";
        protected final String PUNC_PREFIX = "^" + PUNC_MATCH;
        protected final String PUNC_SUFFIX = PUNC_MATCH + "$";
        public String fixPrefix (String w)
            return w.replaceFirst(PUNC_PREFIX, "");
        public String fixSuffix (String w)
            return w.replaceFirst(PUNC_SUFFIX, "");
        }This replaces all leading and trailing punctuation with "" and it works. However, changing the replaceFirst's to just replace doesn't work. I don't understand why that is. Doesn't the ^ mean in the front, and doesn't the $ mean in the back, so shouldn't this work by just changing replaceFirst to replace?

    JFactor2004 wrote:
    I have some sample code for string editing using regular expressions but I'm a little confused as to it's behavior. Here's what I have:
    public class WordFixer
    protected final String PUNC_MATCH = "[\\d\\p{Punct}]+";
    protected final String PUNC_PREFIX = "^" + PUNC_MATCH;
    protected final String PUNC_SUFFIX = PUNC_MATCH + "$";
    public String fixPrefix (String w)
    return w.replaceFirst(PUNC_PREFIX, "");
    public String fixSuffix (String w)
    return w.replaceFirst(PUNC_SUFFIX, "");
    }This replaces all leading and trailing punctuation with "" and it works. However, changing the replaceFirst's to just replace doesn't work. I don't understand why that is. The first parameter of the replaceFirst(...) is a regex-String. And the ^, $ and [...] stuff all have a special meaning in the regex language. The replace(...) method takes plain-Strings as a parameter, so the String "^\[\\d\\p{Punct}\]+" is interpreted as just that, without any special meaning.
    JFactor2004 wrote:
    Doesn't the ^ mean in the front, and doesn't the $ mean in the back, Yes, ^ means the start of the String (sometimes the start of a line) and $ means the end of the String (sometimes the end of a line).
    JFactor2004 wrote:
    so shouldn't this work by just changing replaceFirst to replace?Nope, see the explanation above.

  • Litte help with regular expression?

    Greetings all,
    I have a simple regular expression "(\\w+)\\s(\\w+)\\s(.+)"
    Which I want to match against the strings like "Acetobacter pasteurianus LMD22.1"
    But this always fails whenever there is a dot (.) character like "LMD22.1" in above string.
    How to solve this ?
    Thanks in advance.

    Shouldn't that be Acinetobacter?
    edit: nope, I'm wrong, you're right.
    Edited by: Encephalopathic on Apr 7, 2009 7:34 PM

  • Help with regular expression to not run shtml-hacktype on particular reqs

    Hi,
    Okay, back to 7.0 u2 not ignoring things it should. Our regular site has a lot of SHTML includes. Then we have the glassfish loadbalancer plugin configured for a back-end web application. The problem is, the application URLs end in .html and the web server is looking locally for those requests. If I disable:
    ObjectType fn="shtml-hacktype"In the instance obj.conf, then the requests process normally in the proxy.
    I can't do that, though, because of the includes - then our main site doesn't function properly.
    Is there a way I can surround that line with something like "if request is not /gog/*" then execute? Similar to what I had to do for the j2ee problem looking locally instead of on the back end Weblogic servers.
    <If $uri =~ '^/wp-(.*)'>
    NameTrans fn="ntrans-j2ee" name="j2ee"
    </If>Only I want the opposite - if $uri is not equal to '^/gog/(.*)' then execute the shtml hacktype. I just don't know exactly what the expression would be.
    Thanks!

    Nevermind - I got it. RTFM :-)
    <If $uri !~ '^/gog/(.*)'>
    ObjectType fn="shtml-hacktype"
    </If>

  • Please help with regular expression

    Hello,
    With the help of my previous posting answers, Re: Procedure to Extract multiple substring from a string , I updated the query. But, I am not getting desired answer in all case. Could you please help me out? My query is based on the previous posting. Any other simple way to achieve this?
    I will really appreciate it.
    select
           ltrim ( regexp_substr(txt, '\[(\w+)', 1, level), '[')      as id, /* id is number */
           ltrim ( regexp_substr(ltrim ( regexp_substr(txt, ':[^]]+', 1, level), ':'), '\w+-*\d*', 1, 1), ':')  as qid, /* Qid could be char/number/space any combination except ':' */
           ltrim ( regexp_substr(ltrim ( regexp_substr(txt, ':[^]]+', 1, level), ':'), '\w+', 1, 2), ':')      as num,
          to_date( ltrim ( regexp_substr(ltrim ( regexp_substr(txt, ':[^]]+', 1, level), ':'), '[^:]+', 1, 3), ':'),'MM/DD/YY')   as effdate
    from  (
                            select  '[10946:M100:N:][10947:Q1222:N:][38198:PPP-2:N:][13935:PPP-6:N:][38244:QQQ-4:Y:01/01/10]'     as txt
                            from     dual
            connect by level <= length(regexp_replace(txt, '[^[]'));I should get :
    ID             QID          NUM         EFFDATE
    10946     M100     N     
    10947     Q1222     N     
    38198     PPP-2     N     
    13935     PPP-6     N     
    38244     QQQ-4     Y     01-JAN-10But, getting
    ID             QID          NUM          EFFDATE
    10946     M100     N     
    10947     Q1222     N     
    38198     PPP-2     2     
    13935     PPP-6     6     
    38244     QQQ-4     4     01-JAN-10Thanks,

    Hi,
    So the num column is wrong, is that it?
    Describe what the num column should be. For example "num is the 3rd part of the :-delimited list enclosed in the square brackets".
    If that's what you want, then change the definition of num from
    ...                     ltrim ( regexp_substr(ltrim ( regexp_substr(txt, ':[^]]+', 1, level), ':'), '\w+', 1, 2), ':')      as num,to
    ...                      REGEXP_SUBSTR  ( REGEXP_SUBSTR ( txt
                                          , '[^]]+'
                                                , 1
                                       , LEVEL
                             , '[^:]+'
                             , 1
                             , 3
                             )       AS num,

  • Help with regular expression

    we are currently using this below regex for a date field ,
    ^\d\d/\d\d/\d\d\d\d$ now i have to modify this or put in a new regex to accept 00 for date and month
    Now
    00/23/1985 or 23/00/1985 - gives error
    i want to modify this regex so that
    00/00/1985 or 00/12/1985 or 12/00/1985 does not give error.
    thanks :)

    What am I missing?
           String pattern = "^\\d\\d/\\d\\d/\\d\\d\\d\\d$";
            System.out.println("00/23/1985".matches(pattern));
    as expected returns 'true'.

  • Need help with Regular Expressions

    This is my XML code
    *<name>J. E. O'Rrrrrr, S. Mmmmmmmmmm, B. G. Mmmmmmmm, A. B. C. Xxxxxx Yyyyy, A. B. C. Zzzz and C. R. McCcccc</name>*
    This is my source code
    Regex = Pattern.compile("<name>.*?</name>");
    RegexMatcher = Regex.matcher(fetchWholeFile);
    while(RegexMatcher.find())
    chkEnty = RegexMatcher.group();
    Pattern RegexTry1 = Pattern.compile("([A-Z]{1}\\.[A-Z]{1}\\.[A-Z]{1}\\.){color:#ff6600}|{color}([A-Z]{1}\\.\\s[A-Z]{1}\\.\\s[A-Z]{1}\\.){color:#ff6600}|{color}([A-Z]{1}\\.[A-Z]{1}\\.){color:#ff6600}|{color}([A-Z]{1}\\.\\s[A-Z]{1}\\.){color:#ff6600}|{color}([A-Z]{1}\\.)");
    //In the above line I am trying to catch all the initials (3 initals, 2 initials & 1 initial)
    Matcher RegexMatcherTry1 = RegexTry1.matcher(chkEnty);
    while(RegexMatcherTry1.find())
    String chkEntyTry1 = RegexMatcherTry1.group();
    Tagged11="<fname>"+chkEntyTry1+"</fname>";
    fetchWholeFile=fetchWholeFile.replace(chkEntyTry1,Tagged11);
    After executing the above code, my out is
    *<name><fname>J.</fname>* E. O'Rrrrrr, *<fname>S.</fname>* Mmmmmmmmmm, *<fname><fname><fname><fname>B.</fname></fname></fname></fname> <fname>G.</fname>* Mmmmmmmm, *<fname>A.</fname>* *<fname><fname><fname><fname>B.</fname></fname></fname></fname>* *<fname>C.</fname>* Xxxxxx Yyyyy, *<fname>A.</fname>* *<fname><fname><fname><fname>B.</fname></fname></fname></fname>* *<fname>C.</fname>* Zzzz and *<fname>C.</fname>* *<fname><fname>R.</fname></fname>* McCcccc*</name>*
    But I need my out as below
    *<name><fname>J. E. </fname><sname>O'Rrrrrr</sname>,* *<fname>S. </fname><sname>Mmmmmmmmmm</sname>*, *<fname>B. G. </fname><sname>Mmmmmmmm</sname>*, *<fname>A. B. C. </fname><sname>Xxxxxx Yyyyy</sname>*, *<fname>A. B. C. </fname><sname>Zzzz </sname>and <fname>C. R. </fname><sname>McCcccc</sname></name>*
    Could some also tell me how do I apply *<sname>*

    prometheuzz my source code as suggested by you is
    public void lineread(String FileName)
         try
              File asciiFile1 = new File(FileName);
              File tmp = new File(asciiFile1.getParent(),"Temp.xml");
              BufferedReader br = new BufferedReader(new FileReader(asciiFile1));
              BufferedWriter bw = new BufferedWriter(new FileWriter(tmp));
              String line = "";
              while((line = br.readLine()) != null)
                   fetchWholeFile+=line;
              Pattern Regex = Pattern.compile("<ref.list>.*?</ref.list>");
              Matcher RegexMatcher = Regex.matcher(fetchWholeFile);
              while(RegexMatcher.find())
                   chkEnty = RegexMatcher.group();
              Regex = Pattern.compile("<name>.*?</name>");
              RegexMatcher = Regex.matcher(chkEnty);
              while(RegexMatcher.find())
                   chkEnty = RegexMatcher.group();
                   Matcher m1 = Pattern.compile("([A-Z]\\.\\s?)+").matcher(chkEnty);
                   while(m1.find())
                        String Fname1=(m1.group());
                        String Fname2=("<fname>"+m1.group()+"</fname>");
                        FnameVector1.addElement(Fname1);
                        FnameVector2.addElement(Fname2);
                   Matcher m2 = Pattern.compile("([A-Z]['a-z]+\\s?)+").matcher(chkEnty);
                   while(m2.find())
                        String Sname1=(m2.group());
                        String Sname2=("<sname>"+m2.group()+"</sname>");
                        SnameVector1.addElement(Sname1);
                        SnameVector2.addElement(Sname2);
              for(int v=0;v<FnameVector1.size();v++)
         System.out.println(FnameVector1.elementAt(v));//It's printing fine here      
              for(int v=0;v<FnameVector2.size();v++)
                   System.out.println(FnameVector2.elementAt(v));//It's printing fine here
                   fetchWholeFile=fetchWholeFile.replace(FnameVector1.elementAt(v).toString(), FnameVector2.elementAt(v).toString());//But if I update to input XML file, it's wrong as shown below
              for(int v=0;v<SnameVector1.size();v++)
         System.out.println(SnameVector1.elementAt(v));//It's printing fine here
              for(int v=0;v<SnameVector2.size();v++)
                   System.out.println(SnameVector2.elementAt(v));//It's printing fine here
                   fetchWholeFile=fetchWholeFile.replace(SnameVector1.elementAt(v).toString(), SnameVector2.elementAt(v).toString());//But if I update to input XML file, it's wrong as shown below
              bw.write(fetchWholeFile);
              bw.flush();
              bw.close();
              br.close();
              File org = new File(FileName);
              System.gc();
              System.out.println(asciiFile1.delete());
              tmp.renameTo(org);
         catch(IOException ioe)
              System.out.println(ioe);
    This is my XML file
    <?xml version="1.0" encoding="UTF-8"?>
    <ref-list>
    <name>A. B. Cccccc and X. Y. Zzzzzz</name>
    <name>K. Name</name>
    The output after executing the above source code is
    <?xml version="1.0" encoding="UTF-8"?>
    <ref-list>
    <name><fname>A. </fname>B. <sname>Cccccc</sname>and <fname>X. <fname>Y. </fname></fname><sname>Zzzzzz</sname></name>
    <name><fname><fname><fname><fname><fname><fname>K. </fname></fname></fname></fname></fname></fname><sname>Name</sname></name>
    But I need my output as
    <?xml version="1.0" encoding="UTF-8"?>
    <ref-list>
    <name><fname>A. B. </fname><sname>Cccccc</sname>and <fname>X. Y. </fname><sname>Zzzzzz</sname></name>
    <name><fname>K. </fname><sname>Name</sname></name>
    Please tell me where have I gone wrong.

  • Regular expression for DBCC

    Hi Everyone,
    I need help with regular expression for following scenario .
    If any of the DBCC command is run against sql server i want it to be captured . Something like if it starts with DBCC it should be captured .
    For instance following is expression for
    DBCC CheckDB : part="dbcc checkdb", rgxp="(\s|;|^)dbcc\scheckdb\s?\((((to[a-z0-9_\$\#\.\@])|(t[abcdefghijklmnpqrstuvwxyz0-9_\$\#\.\@])|([abcdefghijklmnopqrsuvwxyz]))[a-z0-9_\$\#\.\@]*)\s?\)(\s|;|$)"
    But instead of writing expression for all DBCC commands is there any way to write a regular expression say if  DBCC i want it to be captured .
    Thanks
    Suhas Vallala

    Hi Suhas,
    As Olaf said, regular expressions is not supported in SQL Server. To trace the DBCC event, you can use the SQL Sever Profiler, just tick the Security Audit--> Audit DBCC Event. You can set up a trace in the profiler by following the below tutorial.
    SQL SERVER – Introduction to SQL Server 2008 Profiler
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Using regular expressions for validating time fields

    Similar to my problem with converting a big chunk of validation into smaller chunks of functions I am trying to use Regular Expressions to handle the validation of many, many time fields in a flexible working time sheet.
    I have a set of FormCalc scripts to calculate the various values for days, hours and the gain/loss of hours over a four week period. For these scripts to work the time format must be in HH:MM.
    Accessibility guidelines nix any use of message box pop ups so I wanted to get around this by having a hidden/visible field with warning text but can't get it to work.
    So far I have:
    var r = new RegExp(); // Create a new Regular Expression Object
    r.compile ("^[00-99]:\\] + [00-59]");
    var result = r.test(this.rawValue);
    if (result == true){
    true;
    form1.flow.page.parent.part2.part2body.errorMessage.presence = "visible";
    else (result == false){
    false;
    form1.flow.page.parent.part2.part2body.errorMessage.presence = "hidden";
    Any help would be appreciated!

    Date and time fields are tricky because you have to consider the formattedValue versus the rawValue. If I am going to use regular expressions to do validation I find it easier to make them text fields and ignore the time patterns (formattedValue). Something like this works (as far as my very brief testing goes) for 24 hour time where time format is HH:MM.
    // form1.page1.subform1.time_::exit - (JavaScript, client)
    var error = false;
    form1.page1.subform1.errorMsg.rawValue = "";
    if (!(this.isNull)) {
      var time_ = this.rawValue;
      if (time_.length != 5) {
        error = true;
      else {
        var regExp = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/;
        if (!(regExp.test(time_))) {
          error = true;
    if (error == true) {
      form1.page1.subform1.errorMsg.rawValue = "The time must be in the format HH:MM where HH is 00-23 and MM is 00-59.";
      form1.page1.subform1.errorMsg.presence = "visible";
    Steve

  • Need a regular expression for the text field

    Hi ,
    I need a regular expression for a text filed.
    if the value is alphanumeric then min 3 char shud be there
    and if the value is numeric then no limit of chars in that field.[0-9].
    Any help is appriciated...
    thanks
    bharathi.

    Try the following in the change event:
    r=/^[a-z]{1,3}$|^\d+$/i;
    if (!r.test(xfa.event.newText))
    xfa.event.change="";
    Kyle

Maybe you are looking for

  • I cannot use facetime on my ipod touch

    I cannot use facetime or imessage.  It will not recognize my email

  • LR5 suddenly stopped importing files

    Hi, LR5.6 (and now 5.7) will no longer show any files in the import dialogue. Further, I cannot make Lightroom the default program for opening various file types, such as JPEG. This behaviour started suddenly about a week - 10 days ago, and it has me

  • How to retrieve Lotus notes document url using IMAP

    Hi all, In our application, we are reading emails from Lotus Domino server. We are currently using "Lotus notes java agent" as a scheduler based agent to read the emails and retrieve document notes url as "notes://ServerName@Wipro/__652574FA00254DF5.

  • Workflows remain in starting state

    There is a production sharepoint site and qa sharepoint site. The workflows were made and tested in the qa site. I then made templates of all the list associated and added them to the production sharepoint site. After that I recreated all the workflo

  • ADE doesn't start on windows 7,

    After the installation of ADE without error, I'm able to start ADE. But after restart of my PC I'm not able to start ADE. ADE doesn't start and no error messages appears. I can see ADE started in the "Windows task" but after few second ADE dissapears