I wrote code for matching filepath which have extenstion .ncx ,
pattern = Pattern.compile(\"$(\\\\|\\/)[a-zA-Z0-9_]/.ncx\"); Matcher matcher = pattern.math
In java \ is a reserved character for escaping. so you need to escape the \.
\
pattern=Pattern.compile("$(\\\\|\\/)[a-zA-Z0-9_]/.ncx");