java.util.regex.PatternSyntaxException

Dangling meta character '*' near index 0 *str ^


Solutions on the web587

Solution icon of coderanch
via Coderanch by ch praveen, 1 year ago
Dangling meta character '*' near index 0 *str ^

Solution icon of bugzilla
via Eclipse Bugzilla by maroukhian, 1 year ago
Dangling meta character '*' near index 0 *.0 ^

Solution icon of coderanch
via Coderanch by Karthik Krishnamurthy, 1 year ago
Dangling meta character '*' near index 0 ** ^

Solution icon of coderanch
via Coderanch by somkiat puisungnoen, 10 months ago
Dangling meta character '*' near index 0 *welcome* ^

Solution icon of bugzilla
via java.net Bugzilla by strubin, 1 year ago
Dangling meta character '+' near index 0 ++ ^

Solution icon of oraclecommunity
via Oracle Community by 807594, 1 year ago
Dangling meta character '+' near index 0 + ^

Solution icon of oraclecommunity
via Oracle Community by 807591, 1 year ago
Dangling meta character '*' near index 0 * ^

Solution icon of stackoverflow
via Stack Overflow by juannmcc
, 1 year ago
Dangling meta character '+' near index 0

Solution icon of stackoverflow
Dangling meta character '*' near index 0 * ^

Solution icon of github
Dangling meta character '?' near index 0 ?* ^

Stack trace

  • java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0 *str ^ at java.util.regex.Pattern.error(Pattern.java:1489) at java.util.regex.Pattern.sequence(Pattern.java:1606) at java.util.regex.Pattern.expr(Pattern.java:1506) at java.util.regex.Pattern.compile(Pattern.java:1274) at java.util.regex.Pattern.<init>(Pattern.java:1030) at java.util.regex.Pattern.compile(Pattern.java:777) at ListFiles$1.accept(ListFiles.java:19) at java.io.File.list(File.java:951) at ListFiles.printList(ListFiles.java:24) at ListFiles.toString(ListFiles.java:58) at java.lang.String.valueOf(String.java:2177) at java.io.PrintStream.print(PrintStream.java:462) at java.io.PrintStream.println(PrintStream.java:599) at ListFiles.main(ListFiles.java:75)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Once, 2 weeks ago
Once, 2 months ago
14 times, 4 months ago
Once, 5 months ago
2 times, 6 months ago
24 more bugmates