Tag Archives: 正则表达式

Flex:使用正则表达式替换String

需求: 通过某些字符串生成文件名称, 简单要求: 仅允许数字或字母及”_” 代码:

var regExp:RegExp = new RegExp(“[^A-Za-z0-9_]“, “g”); // 正则表达式, 将非字母数字或下划线的字符替换为”_”, 全部替换.
fi

Posted in ActionScript | Tagged , , , | Leave a comment

Java正则表达式使用笔记

1. 编写并测试正则表达式.

使用工具:

Eclipse 正则表达式书写测试插件 – 基于java.util.regex

 

2.

//定义正则表达式

//定义正则表达式
private static final String REGEX_EMAIL = “([\\w

Posted in Java | Tagged , , | Leave a comment

Eclipse 正则表达式书写测试插件 – 基于java.util.regex

Screenshot:

image

Download the plugin

Last version: Download

Update site: http://regex-util.sourceforge.net/update/

更多信息: http://myregexp.com/eclipsePlugin

Posted in Java | Tagged , , | Leave a comment