# Parse string for A-Z,a-z,0-9 only

**URL:** https://forum.kirupa.com/t/parse-string-for-a-z-a-z-0-9-only/294953
**Category:** flash
**Created:** [August 23, 2009, 5:22am UTC](https://forum.kirupa.com/t/parse-string-for-a-z-a-z-0-9-only/294953 "2009-08-23T05:22:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Shaedo](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Shaedo](https://forum.kirupa.com/u/Shaedo)
#### Post date: [August 23, 2009, 5:22am UTC](https://forum.kirupa.com/t/parse-string-for-a-z-a-z-0-9-only/294953/1 "2009-08-23T05:22:08Z")

</div>

Hi all,

Just wondering if anyone has a good function for parsing a string in as3 to remove all characters that are not alphanumeric (and ideally being able to add a few more characters such as \_ )

I want to use it to check user input before sending it to PHP (which checks it as well but I would like to have the user side ie flash check it first).

I am sure I could write it by creating an array of the characters I want it limited to and working through each character in the user input and removing those that don’t match; but this seems slow and cumbersome.

Alternatively passing it to PHP and having that use its string functions to check then pass back to flash; but I would rather it done purely on the Flash side.

Thanks for your consideration.
