regex - 正则表达式去除一些特殊字符

标签 regex actionscript-3

我正在寻找一个正则表达式,它可以从字符串(以及空格)中删除所有以下字符:
~ % & \ ; : " ' , < > ? #
你能帮助我吗?我在 ActionScript 3 中编码。

最佳答案

在 ActionScript 中,它就像

yourString.replace(/[~%&\\;:"',<>?#\s]/g,"");

在 Perl 中相同:
$_ = "~ % & \\ ; : \" ' , < > ? #";
s/[~%&\\;:"',<>?#\s]//g;
print; #prints nothing

关于regex - 正则表达式去除一些特殊字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5990868/

相关文章:

actionscript-3 - 重置折线图 y 轴

php - 获取所有嵌套的花括号

php - 正则表达式如何向前看,看看是否有另一个匹配的结束部分?

javascript - 正则表达式不应仅包含空格

c# - 为什么 visual studio 中的正则表达式在程序中不起作用?

actionscript-3 - 如何将相机连接到 Spark.components.VideoDisplay

actionscript-3 - 如何处理两个数据包中收到的信息

javascript - 获取字符串的一部分?

actionscript-3 - AS3 : declaring an "undefined" parameter for int, uint 或数字

actionscript-3 - 反编译、修改和编译 Flash 对象