![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbbM1e2%2FbtrXzZKNQ3K%2Fj123NG4fCq307gLvSEPHik%2Fimg.png)
프로그래밍 언어/JAVA
java.util.regex.PatternSyntaxException : Dangling meta character '+' near index 0
1. 문제상황 String[] sentence = sc.nextLine().split("-"); String[] sperate_plus = sentence[i].split("+"); +나 - 등 특수문자를 가지고 split을 할 때 나타나는 exception이다. 2. 해결방법 String[] sentence = sc.nextLine().split("\\-"); String[] sperate_plus = sentence[i].split("\\+"); +와 - 앞에 \\를 붙여주면 된다.