regular expression that allows all characters except , " ' < > & - InfoPath Dev
in

InfoPath Dev

regular expression that allows all characters except , " ' < > &

Last post 01-19-2012 01:48 PM by bsieloff. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-18-2012 08:20 AM

    regular expression that allows all characters except , " ' < > &

    Hello,

     I am looking to make a field allow all characters except the following

    , " ' < > &

     So far I can only get it to check for the ,

     This is my pattern:    [^,]+

     all the other characters seem to be a special characters.  I tried using the syntax \<  or \&   etc... but infopath rejects that as an invalid pattern.

     is there a way to check for the characters " ' < > & in regular expressions?

     

    Thanks,

    -Bob

    Filed under:
  • 01-18-2012 10:06 AM In reply to

    Re: regular expression that allows all characters except , " ' < > &

    If you're just looking to put data validation on a text box, you can use the following expression as your check in InfoPath for these characters:

    contains(., ",") or contains(., "&") or contains(., "'") or contains(., "<") or contains(., ">") or contains(., '"')

    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 01-19-2012 12:30 PM In reply to

    Re: regular expression that allows all characters except , " ' < > &

    hmmm... This returns a true or false in the text field I'm typing in.  Is there a way to have a validation setup this way so that the user is notified that (s)he has typed in an illegal character?

  • 01-19-2012 12:48 PM In reply to

    Re: regular expression that allows all characters except , " ' < > &

    I believe Anson is suggesting using that expression in the dialog where you set up the validation condition.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-19-2012 01:40 PM In reply to

    Re: regular expression that allows all characters except , " ' < > &

    Yes Jimmy is correct.  For the text box, add data validation and as your condition use the expression I included above.
    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 01-19-2012 01:48 PM In reply to

    Re: regular expression that allows all characters except , " ' < > &

    ahh.. very cool..  

     

    Thanks

Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.