Millisecond Forums

Text box with position of certain letters fixed

https://forums.millisecond.com/Topic31699.aspx

By abhi - 6/9/2021

Hi, 

Is it possible to allow only certain letters within the text box responses ? 

For example, I want respondents to type in a word response of 5 letters, where first letter can only be from a pool of certain letters (e.g., p, t, r ); second letter has to be a vowel only (a e i o u); third letter again is from a pool of given letters (r g h n) ; 4th letter is again a vowels (a e i o u)...

Can /mask/ be used to restrict individual letters within a word ?

If there is a similar script, pl point me towards it.

Thanks
By Dave - 6/9/2021

abhi - 6/9/2021
Hi, 

Is it possible to allow only certain letters within the text box responses ? 

For example, I want respondents to type in a word response of 5 letters, where first letter can only be from a pool of certain letters (e.g., p, t, r ); second letter has to be a vowel only (a e i o u); third letter again is from a pool of given letters (r g h n) ; 4th letter is again a vowels (a e i o u)...

Can /mask/ be used to restrict individual letters within a word ?

If there is a similar script, pl point me towards it.

Thanks

Yes, you can construct a regular expression to match the pattern you described and use that in /mask.

To learn regular expressions, see e.g.https://regexone.com/

By Dave - 6/9/2021

Dave - 6/9/2021
abhi - 6/9/2021
Hi, 

Is it possible to allow only certain letters within the text box responses ? 

For example, I want respondents to type in a word response of 5 letters, where first letter can only be from a pool of certain letters (e.g., p, t, r ); second letter has to be a vowel only (a e i o u); third letter again is from a pool of given letters (r g h n) ; 4th letter is again a vowels (a e i o u)...

Can /mask/ be used to restrict individual letters within a word ?

If there is a similar script, pl point me towards it.

Thanks

Yes, you can construct a regular expression to match the pattern you described and use that in /mask.

To learn regular expressions, see e.g.https://regexone.com/


Your description is missing details regarding the characters allowed for the 5th letter, so here's an example covering only the four you detailed:

<openended example>
/ mask = ^[ptr][aeiou][rghn][aeiou]$
</openended>
By abhi - 6/10/2021

Thanks Dave. 

Working fine.