RegEx for Removing Non-Ascii Chars Except Certain Whitespaces

Richmond richmondmathewson at gmail.com
Wed Jan 29 11:26:11 EST 2014


On 29/01/14 17:43, Thierry Douez wrote:
> 2014-01-29 Ender Nafi Elekcioglu <endernafi at keehuna.com>:
>
>> The statement should clear all whitespaces and non-ascii chars except dash and space.
>>
>> ~ Ender
>
> [ ...]  -> character class; match any characters in between the brackets
> [^...] -> character class; do *NOT* match all characters in between the brackets
>
> So, you can try something like:
>
> put replacetext( mytext, "[^a-zA-Z0-9]", empty) into mytext
>
> a-z  -> any chars from a to z
> A-Z  -> any chars from A to Z
>
> Still missing the dash; add it inside the brackets:
>
> put replacetext( mytext, "[^a-zA-Z0-9-]", empty) into mytext
>
> and carry on adding extra chars until you are happy.
>
> Does that makes sense?
>
>
> Thierry
>
>

Wait a minute . .  .

This is to remove Non-Ascii chars: but what goes on above looks as 
though it is meant to remove more than that.

Richmond.




More information about the use-livecode mailing list