INL / corpus-frontend

BlackLab Frontend, a feature-rich corpus search interface for BlackLab.
16 stars 7 forks source link

Annotation select/dropdowns do not regex-escape brackets `()` #470

Closed KCMertens closed 4 months ago

KCMertens commented 6 months ago

This breaks searching for pos values with features in brackets e.g. nou-c(number=sg)

KCMertens commented 4 months ago

Corpus-frontend correctly escapes regex characters, but the issue lies with BlackLab at the moment, there's been a subtle change somewhere in the last few years where backslashes suddenly need to be doubled.

BlackLab first parses the part between double quotes (") and this removes one set of backslashes (so an escaped \") is let through. Then what is left is passed to lucene, which interprets it as a regex, which would require a second set of backslashes.

First see if we can fix this in BlackLab, otherwise we'll just have to double-escape special characters.

jan-niestadt commented 4 months ago

Fixed in BlackLab dev, see this commit

KCMertens commented 4 months ago

Cool!