Results 1 to 6 of 6

Thread: How to set up regex and maskre?

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    29
    Vote Rating
    0
      0  

    Default Answered: How to set up regex and maskre?

    Hi guys,

    i want to define a textfield where the input must look like: Firstname,Lastname - Job, DD.MM.YYYY HH:MM
    How does the regex and maskre definiton look like?

    Please help me, if you know .

    Nice greets, Victoria

  2. Search for 'regular expressions' on internet. There are _many_ examples.

    Online:
    http://gskinner.com/RegExr/

    There are apps like: regexbuddy

    Scott.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716
    Vote Rating
    505
      -1  

    Default

    Please have a look at vtypes:
    http://docs.sencha.com/ext-js/4-1/#!...m.field.VTypes

    Scott.

  4. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    29
    Vote Rating
    0
      0  

    Default

    I've already read this, but I still do not no how to combine this differnt things like /[A-Z]/ and date with "," or "-".

  5. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716
    Vote Rating
    505
      1  

    Default

    Search for 'regular expressions' on internet. There are _many_ examples.

    Online:
    http://gskinner.com/RegExr/

    There are apps like: regexbuddy

    Scott.

  6. #5
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106
    Vote Rating
    27
      0  

    Default

    In the long run, I think you're going to cause yourself headaches by trying to fit this many disparate kinds of data into a single field. A much better alternative would be to break out each of these data items into their own fields, where this will make each field must easier to mask/validate. This would also let you use an Ext.form.field.Date field to capture the date/time portion of your data, where you'll get the nice GUI date picker plus a lot of helpful formatting and validation options.

    Breaking everything out into multiple fields will also help you on the server-side, where you'll have individual request parameters for each field and won't have to worry about parsing a delimited String and doing data conversions.

    If a design requirement is forcing you to use a single field, keep in mind that the maskRe regex expression only filters out undesirable keystrokes, but won't do anything to stop a user from entering desired keystrokes in a particular order. As for the regex expression, it's only used to validate what the user has entered and won't physically stop them from putting in poorly formatted data; it just turns the field red if the data entered doesn't match the desired format.

  7. #6
    Sencha User
    Join Date
    Jul 2012
    Posts
    29
    Vote Rating
    0
      0  

    Default

    Thanks for your answers, I finally decided to make different fields for text, date and time.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •