Regex search where a string field ends with $

(Elvar) #1

I'm trying to exclude computer accounts from a query, they are always identified with a $ sign at the end.
works but turning this into a regex search does not,
Does not work and neither does when you excape the dollar sign

My ideal solution would be something like this
NOT SubjectUserName:/.*\$/

(Jon Budzenski) #2

Lucene patterns are always anchored, so your query needs to match the entire string. For reference,

Something like NOT SubjectUserName:/.*$/ should work if the field is not analyzed.

(Elvar) #3

Ah, of course, I will try it against the .raw field tomorrow

(Elvar) #4

Using the .raw field works :smile:

(system) #5