使用str.split("[",15)时,出现Exception in thread "main" java.util.regex.PatternSyntaxException: Unclosed character class near index 0 [ ^的问题

解决办法为在[加上\\转义

str.split("\\[",15)   

Exception in thread "main" java.util.regex.PatternSyntaxException: Unclosed character class near index 0 解决方法: 要对切割字符进行转义\\的更多相关文章

  1. Exception in thread "main" java.util.regex.PatternSyntaxException: Unclosed character class near index 0 [ ^

    Exception in thread "main" java.util.regex.PatternSyntaxException: Unclosed character clas ...

  2. java.util.regex.PatternSyntaxException: Unclosed character class near index解决办法

    使用str.split("[")时,出现java.util.regex.PatternSyntaxException: Unclosed character class near  ...

  3. Exception in thread "main" java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s) for topic_test_1219-2: 30010 ms has passed since batch creatio

    代码如下 public static void producer1() throws ExecutionException, InterruptedException { Properties pro ...

  4. Exception in thread "main" java.util.ConcurrentModificationException解决方案

    我想判断一个集合里面有没有"world"这个元素,如果有,我就添加一个"javaee"元素, 当时的做法是: public class ListIterator ...

  5. 编译运行java程序出现Exception in thread "main" java.lang.UnsupportedClassVersionError: M : Unsupported major.minor version 51.0

    用javac编译了一个M.java文件, 然后用java M执行,可是出现了下面这个错误. Exception in thread "main" java.lang.Unsuppo ...

  6. java.util.regex.PatternSyntaxException: Unexpected internal error near index 1 \ ^

    1 String a = "1991\12\16"; 2 String[] split = a.split("\\"); 3 System.out.printl ...

  7. Exception in thread "main" java.lang.UnsupportedClassVersionError : unsupported major.minor version 52.0

    新建好springboot项目后,打开application运行main方法报如下错. 1.问题:Exception in thread "main" java.lang.Unsu ...

  8. 字符串replaceAll()方法报错:java.util.regex.PatternSyntaxException:Unclosed group near index...

    Unclosed group near index错误 之前自己写的一个模块在项目上线后最近频频出现tomcat崩掉的情况,从log看出现如下的报错信息: java.util.regex.Patter ...

  9. MyBatis笔记----报错:Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方法

    报错 Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound st ...

随机推荐

  1. java内存泄漏与内存溢出

    https://www.cnblogs.com/panxuejun/p/5883044.html 内存溢出 out of memory,是指程序在申请内存时,没有足够的内存空间供其使用,出现out o ...

  2. Zookeeper本地模式安装

    本地模式安装部署 1.安装前准备 (1)安装Jdk (2)拷贝Zookeeper安装包到Linux系统下 (3)解压到指定目录 tar -zxvf zookeeper-3.4.10.tar.gz -C ...

  3. jQuery的基本过滤器与jQuery实现隔行换色实例

    没加过滤器之前: 加过滤器之后: 总的代码: <!DOCTYPE html> <html> <head> <meta charset="UTF-8& ...

  4. pycharm 安装激活操作

    pycharm 安装激活操作 什么是 PyCharm PyCharm是一种Python IDE,带有一整套可以帮助用户在使用Python语言开发时提高其效率的工具,比如调试.语法高亮.Project管 ...

  5. vue2.0之element table的使用

    说明: 1.改变表头居中问题:    需要在el-table-column中添加  header-align="center" <el-table :data="t ...

  6. 【python002-设计小游戏】

    用python设计第一个游戏 一.运行idle的快捷方式:F5 二.首先设计一款小游戏: print('-------开启python学习之旅--------')temp = input(" ...

  7. 对应web的常用flutter应用

    例如,创建一个Text widget: new Text('Hello World', style: new TextStyle(fontSize: 32.0)) 创建一个 Image widget: ...

  8. (转)mblog解读(一)

    (二期)11.开源博客项目mblog解读(一) [课程11]图片上传模块.xmind54.6KB [课程11]消息发...通知.xmind55.2KB [课程11]异常处理分析.xmind95.4KB ...

  9. JMeter常用菜单以及设置

    如何清空View Results Tree 先选中目标view results tree,然后在菜单上选择Run-->Clear https://stackoverflow.com/questi ...

  10. R: Coercing LHS to a list

    #  Coercing LHS to a list expr_3$ID<-rownames(expr_3) # OK ids<-rownames(expr_3)expr_4<-cbi ...