# TextField restrict property and RegExp?

**URL:** https://forum.kirupa.com/t/textfield-restrict-property-and-regexp/294244
**Category:** flash
**Created:** [August 11, 2009, 11:29am UTC](https://forum.kirupa.com/t/textfield-restrict-property-and-regexp/294244 "2009-08-11T11:29:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jdoe](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@jdoe](https://forum.kirupa.com/u/jdoe)
#### Post date: [August 11, 2009, 11:29am UTC](https://forum.kirupa.com/t/textfield-restrict-property-and-regexp/294244/1 "2009-08-11T11:29:50Z")

</div>

Hi:

It seems it isn’t possible to use RegExp with restrict property, any workaround? I received this specification for dates in an input field:

^((0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[0-2])/(19[0-9][0-9]|2[0-9][0-9][0-9]))$

Besides the AS editor behaves weird when escaping chars like adding one char after the last quote, usually an space and sometimes others chars like the 6 in this example. Anyway the code seems to work fine

via.restrict = “0-9A-Za-zñÑáéíóúÁÉÍÓÚçÇäëïöüÄËÏÖÜàèìòùÀÈÌÒÙ· /.,\-ºª”’"6;

CS3, OS X 10.4.11

============

Is it possible to intercept chars typed before they are displayed?
