Opened 16 years ago
Closed 15 years ago
#2473 closed defect (fixed)
Search does not work when searching for value containing literal quote
Reported by: | anonymous | Owned by: | team |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Core | Version: | latest |
Keywords: | search | Cc: |
Description
I tried searching for values containing a quote (the literal quote character: ")
but with some my attempts it failed:
"
\"
""""
"\""
as regex:
["]
[\"]
"[\"]"
the search either found nothing, spitted out some error or matched all data.
Seems there is not way to search for literal value that contains the quote character
Attachments (0)
Change History (4)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
The code in question is this from around line 60 in PushbackTokenizer.java:
case '"': s = new StringBuilder(" "); for (int nc = search.read(); nc != -1 && nc != '"'; nc = search.read()) s.append((char)nc); return s.toString();
It would need to be changed to support "\"", "
", "
" etc. Keeping in mind that the user may want to search for a literal \, especially when using regex search.
comment:3 by , 15 years ago
Keywords: | search added |
---|
comment:4 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
You can search for e.g. \x22 using regex search instead of " as a workaround. But the search engine's tokenizer should have facility for balancing escaped quotes.