Opened 15 years ago
Closed 14 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 Changed 15 years ago by
comment:2 Changed 15 years ago by
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 Changed 14 years ago by
Keywords: | search added |
---|
comment:4 Changed 14 years ago by
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.