Modify

Opened 4 years ago

Closed 3 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 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 4 years ago by avar

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 4 years ago by avar

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 3 years ago by avar

  • Keywords search added

comment:4 Changed 3 years ago by mjulius

  • Resolution set to fixed
  • Status changed from new to closed

(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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.