Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Help with Regex to check for form input - Complex

Last post 05-15-2008, 7:23 PM by Aussie Susan. 15 replies.
Page 1 of 2 (16 items)   1 2 Next >
Sort Posts: Previous Next
  •  05-14-2008, 11:44 AM 42254

    Help with Regex to check for form input - Complex

    Hi All,

    Need help with regular expression to check for form input  which is in following criteria.

    A (numeric) (numeric) (numeric) (numeric) (alpha) - [aA]\d{4}[a-zA-Z] - example A1234Z

    System should accept anything other that String A1234Z, i tried this but didnot work

    !([aA]\d{4}[a-zA-Z])

    Any help is helpful.

    Thanks.

     

  •  05-14-2008, 3:27 PM 42263 in reply to 42254

    Re: Help with Regex to check for form input - Complex

    anish:

    Hi All,

    Need help with regular expression to check for form input  which is in following criteria.

    A (numeric) (numeric) (numeric) (numeric) (alpha) - [aA]\d{4}[a-zA-Z] - example A1234Z

    System should accept anything other that String A1234Z, i tried this but didnot work

    !([aA]\d{4}[a-zA-Z])

    Any help is helpful.

    Thanks.

     

    Why does your attempt have an exclamation point?


    Michael

    "In theory, theory and practice are the same. In practice, they are not."
    Albert Einstein
  •  05-14-2008, 7:28 PM 42267 in reply to 42263

    Re: Help with Regex to check for form input - Complex

    I think he might be using the exclamation mark in the sense that some programming languages use it: 'not' as in logical negation.

    As for the possible solution (lacking any knowledge of the regex/langauge/paltform etc (OP - please read the posting guidelines in the sticky note at the strat ofm this forum)), try:

    ^(?!A\d{4}[a-z]$).*$

    with the 'ignore case' option on, which will accept anything other than the pattern in the lookahead.

    Of course, if this is embedded in a programming language, then you could do something like the following pseudo-code:

    regexExpression re = regexMatch("[aA]\d{4}[a-zA-Z]")
    if( !re.matchesTheText(someText))
    then
        do something knowing that someText does NOT match the pattern
    end

    I think this is what the OP was thinking about.

    Susan
     

  •  05-15-2008, 9:04 AM 42298 in reply to 42267

    Re: Help with Regex to check for form input - Complex

    Thanks for your quick reply, i am using this as a part of validtor.xml in struts frame work. It works. 

     

  •  05-15-2008, 11:25 AM 42300 in reply to 42254

    Re: Help with Regex to check for form input - Complex

    hi,

    i am the new member to this blog,

    i have one problem,am using to identify any window name which contains one string,it was working fine but now i dont want to identify the word "Auto"

    currently am using [A-Z]*[a-z]*,

    can i know modification or any new RE

     

    thanks,

    chinnu

  •  05-15-2008, 11:25 AM 42301 in reply to 42300

    Re: Help with Regex to check for form input - Complex

    sorry [A-Z]*[a-z]* this is one am using
  •  05-15-2008, 11:26 AM 42302 in reply to 42300

    Re: Help with Regex to check for form input - Complex

    sorry [A-Z]*[a-z]* this is one am using
  •  05-15-2008, 11:26 AM 42303 in reply to 42300

    Re: Help with Regex to check for form input - Complex

    sorry [A-Z]*[a-z]* this is one am using
  •  05-15-2008, 11:26 AM 42304 in reply to 42300

    Re: Help with Regex to check for form input - Complex

    sorry [A-Z]*[a-z]* this is one am using
  •  05-15-2008, 11:26 AM 42305 in reply to 42300

    Re: Help with Regex to check for form input - Complex

    sorry [A-Z]*[a-z]* this is one am using
  •  05-15-2008, 11:26 AM 42306 in reply to 42300

    Re: Help with Regex to check for form input - Complex

    sorry [A-Z]*[a-z]* this is one am using
  •  05-15-2008, 11:26 AM 42307 in reply to 42300

    Re: Help with Regex to check for form input - Complex

    sorry [A-Z]*[a-z]* this is one am using
  •  05-15-2008, 11:26 AM 42308 in reply to 42300

    Re: Help with Regex to check for form input - Complex

    sorry [A-Z]*[a-z]* this is one am using
  •  05-15-2008, 11:26 AM 42309 in reply to 42300

    Re: Help with Regex to check for form input - Complex

    sorry [A-Z]*[a-z]* this is one am using
  •  05-15-2008, 11:26 AM 42310 in reply to 42300

    Re: Help with Regex to check for form input - Complex

    sorry [A-Z]*[a-z]* this is one am using
Page 1 of 2 (16 items)   1 2 Next >
View as RSS news feed in XML