srkp.net
当前位置:首页 >> jAvA中正则表达式如何匹配竖线(|) >>

jAvA中正则表达式如何匹配竖线(|)

^\s+|\s+$//匹配字符串开始或结束的所有空白字符baidu\.(com|cn)//匹配baidu.com或baidu.cn

import java.util.regex.*; public class RegexTest { private static String ONE = "49785790f0aba048e55a0289f377edb4"; private static String PATTERN = "(com/7655/zh-cn/preview/)(\\w{" + ONE.length() + "})(/preview)"; public static ...

var reg = /^[\d\(\)()\-\|]+$/;

select '|' regexp '\\|' select '|' rlike '\\|' 也是一样的 O(∩_∩)O~

var reg = /[\s\|]/g; var str = "asd s|sdf d|df"; str.split(reg)

\w+\|\d+

网站首页 | 网站地图
All rights reserved Powered by www.srkp.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com