Modify

Opened 11 years ago

Closed 10 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 11 years ago by avarab@…

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.

comment:2 Changed 11 years ago by avarab@…

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 10 years ago by avarab@…

Keywords: search added

comment:4 Changed 10 years ago by mjulius

Resolution: fixed
Status: newclosed

(In [2777]) fixes #2473 - Search does not work when searching for value containing literal quote
Quotes within quoted strings can now be escaped with backslash.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.