I want to remove all characters in a string except:
-
or_
or.
A
thruZ
a
thruz
0
to9
- space
On linux command line, using sed
I would do this:
$ echo "testing-#$% yes.no" | sed 's/[^-_.a-zA-Z0-9 ]//g'
Output:
testing- yes.no
How can I achieve the same effect in Red language with PARSE? I looked at:
- http://www.rebol.com/docs/core23/rebolcore-15.html#section-1
- http://rebol-land.blogspot.in/2013/03/rebols-answer-to-regex-parse-and-rebol.html
- http://ross-gill.com/page/Beyond_Regular_Expressions
However, I could not codify it. I tried:
>> parse "mystring%^&" [#a - #z #A - #Z #0 - #9]
== false
>> parse "mystring%^&" [#a-#z#A-#Z#0-#9]
== false
trim
if you want to remove some chars.trim/with "testing-#$% yes.no" "-#$%." == "testing yesno"
– Bournemouth