regex - regular expression in java compile -
this regular expression, use on command line, when put same expressing on java pattern.compile, giving error
this regex /,.*"(.*)",\[6]/
this how trying in java
pattern p = pattern.compile("/,.*"(.*)",\[6]/"); but in eclipse showing error, 1 on this.
you have escape double quotes (and possibly blackslash) using backslashes.
edit:
it seems want this
,.*\"(.+)\",\\[6\\] you don't have include forward slashes in patterns in java. if know have between quotes, use + instead of *, , have escape square brackets, because want literal match.
Comments
Post a Comment