java正则表达式: 
(?i)abc  表示abc都忽略大小写 
a(?i)bc   表示bc忽略大小写 
a((?i)b)c   表示只有b忽略大小写

也可以用Pattern.compile(rexp,Pattern.CASE_INSENSITIVE)表示整体都忽略大小写

例子:

public static void main(String arg[]){
String ss = "";
System.out.println(ss.replaceAll("(?i)p", ""));
}

JAVA正则忽略大小写的更多相关文章

  1. json字符转java bean忽略大小写

    使用objectMapper进行json字符的解析 com.fasterxml.jackson.databind.ObjectMapper ob =new com.fasterxml.jackson. ...

  2. java 正则表达式-忽略大小写与多行匹配

    Pattern.compile("'.*?'", Pattern.CASE_INSENSITIVE | Pattern.DOTALL);

  3. java replaceAll 忽略大小写

    public static void main(String[] args) { String temp=" CLASS_path : /aaabb/"; System.out.p ...

  4. Java字符串替换忽略大小写

    今天在做字符串替换时忽略大小写,网上找到了一个非常简便的方法,使用String的replaceAll方法. java.lang.String.replaceAll(String regex, Stri ...

  5. java正则表达式的忽略大小写

    (?i)abc 表示abc都忽略大小写  a(?i)bc 表示bc忽略大小写  a((?i)b)c 表示只有b忽略大小写

  6. android开发之java代码中字符串对比忽略大小写。java程序员必回,可用来比对验证码等问题

    比如:字符串a与字符串B对比,只需调用 a.equalsIgnoreCase(B);即可.很简单的一个方法.忽略大小写.

  7. Spring Mvc Url和参数名称忽略大小写

    在开发过程中Spring Mvc 默认 Url和参数名称都是区分大小写的 比如:www.a.com/user/getUserInfo?userId=1 www.a.com/user/getuserIn ...

  8. solr 忽略大小写

    1.types标签下加入如下fieldType <fieldType name="str_lower" class="solr.TextField" so ...

  9. java 正则举例

    Greedy 数量词 X? X,一次或一次也没有 X* X,零次或多次 X+ X,一次或多次 X{n} X,恰好 n 次 X{n,} X,至少 n 次 X{n,m} X,至少 n 次,但是不超过 m ...

随机推荐

  1. git 基础命令

    1.git init git 初始化仓库 2.git add . git 添加全部文件 3.git add xxx.txt   git 添加单独文件 4.git commit -m "提交的 ...

  2. Web Adaptor重装配置时 提示已经配置成功的问题

    环境 ArcGIS 10.1/10.2/10.3 Windwos 8.1 Tomcat 7.0.5 问题描述 较早之前在本机上安装配置过一个10.2.1版本的ArcGIS产品,包括桌面.Server和 ...

  3. iptables 配置需要保存

    iptables-save > /root/myiptables 将iptables规则导入到文件/root/myiptablse iptables-restore < /root/myi ...

  4. 【poj2891】同余方程组

    同余方程组 例题1:pku2891Strange Way to Express Integers 中国剩余定理求的同余方程组mod 的数是两两互素的.然而本题(一般情况,也包括两两互素的情况,所以中国 ...

  5. Qt动画与Qt坐标小记

    Qt动画 转载自: <http://jingyan.baidu.com/article/154b46315757b628ca8f4116.html> 和  <http://blog. ...

  6. SQL server 时间日期函数、类型转换

    一.日期与时间函数 二.子查询与分页查询

  7. Android GradientDrawable类的详解,设置activity的背景颜色渐变效果

    看到这个例子的标题RoundRects,我的第一感觉是介绍RoundRectShape, 打开例子看了代码却是使用GradientDrawable来实现的. GradientDrawable 支持使用 ...

  8. C 常用的输入输出 栈 哈希 文件写读 实现 字符串处理

    #include "stdafx.h"#include <stdio.h>#include <string.h>#include <stdlib.h& ...

  9. jQuery动态五星评分

    效果 css .star ul, .star li { list-style: none; } .star { position: relative; width: 600px; height: 24 ...

  10. Defining as a "long" or "int" type throws an error on startup

    solr启动时候,报如下异常: [java] view plaincopy SEVERE: org.apache.solr.common.SolrException          at org.a ...