java - Match regular expression with quotes inside? -
I have to read while a file that uses regular expressions string basically anything (upper case, lower than Case, spaces, symbols, etc.), as long as the line does not exceed 60 characters. The method I tried, works for most strings in the file, however, I need to be able to allow quotation marks, which is where I'm stuck. Even I have tried so far.
else if (data.matches ("[A-Za-z0-9,.?!% & Amp; () @ $ -_:; \\\"] + $ " ) & amp ;! Label.equals ( "") and amp; amp; and amp; shortly. angle ( "") & amp; amp; amp; and amp; data. Lamp () & lt; = 60) {prompt = data;} it reads everything except string down properly
Yes, but displays an error, "Fyusr out "Â Do not ask about the spelling, that was the sample file I was given.
Thanks for any help, hopefully I Before that i am Will meet a response before leaving Ndromat, because I have no power or internet at home and I storm on Long Island.
the regular expression \ " Add below: data.matches (" [a-Za-z0-9,.?! % Where \ " is used, it is < Code> " in a verbatim form to match.
Comments
Post a Comment