That is awesome! I wasn’t aware of KEEP and suspect it will do what I need.

Thanks also for the explanation on REGEX. I wondered why I couldn’t get it to 
work.

Wayne

> On 20 Jul 2018, at 7:17 am, Robert Shubert <[email protected]> wrote:
>
> Before we get into the regex, @KEEP might be an option:
>
> <@! "remove everything but letters and numbers">
> <@KEEP <@ARG input> abcdefghijklmnopqrstuvwxyz1234567890>
>
> Regex in @REPLACE works a little differently than what the SO article says. I 
> adapted one of the answers to this:
>
> <@REPLACE <@ARG input> findstr="[^0-9a-zA-Z]" replacestr="" type="regex">
>
> Lastly, there's an easy way to use the bit of JavaScript right from the SO 
> answer, which you can run server-side:
>
> <@SCRIPT expr='"<@ARG input encoding=javascript>".replace(/\W/g, "")'>
>
> Robert
>
> -----Original Message-----
> From: Wayne Irvine [mailto:[email protected]]
> Sent: Wednesday, July 18, 2018 7:21 PM
> To: [email protected]
> Subject: TeraScript-Talk: Remove non-alphanumeric characters
>
> I have a situation where users might type in a string and I need to make a 
> simple alphanumeric code from it.
>
> Previously I’ve used a bunch of REPLACE statements, but you can never 
> underestimate fools. ;)
>
> I’m playing around with REGEX (again) and as usual, it has me stumped. I 
> would like to code a simple REGEX (oxymoron) statement that will take a 
> string of characters and return either a string with only alphanumerics and 
> spaces, or an array of strings with only alphanumerics.
>
> Wayne
>
> Byteserve Pty Ltd
> w: http://www.byteserve.com.au/
> e: [email protected]
> p: +61 02 9960 6099
> m: 0409 960 609
> f: +61 02 9960 6088
>
>
>
>
> ----------------------------------------
>
> To unsubscribe from this list, please send an email to 
> [email protected] with "unsubscribe terascript-talk" in the body.
>
>
>
>
> ----------------------------------------
>
> To unsubscribe from this list, please send an email to 
> [email protected] with "unsubscribe terascript-talk" in the body.
>

Byteserve Pty Ltd
w: http://www.byteserve.com.au/
e: [email protected]
p: +61 02 9960 6099
m: 0409 960 609
f: +61 02 9960 6088




----------------------------------------

To unsubscribe from this list, please send an email to [email protected] 
with "unsubscribe terascript-talk" in the body.

Reply via email to