Regex Pattern Matching

37 views
Skip to first unread message

Kishor Shaw

unread,
Mar 6, 2023, 11:13:15 AM3/6/23
to cqengine-discuss
Hi,


I need one help regarding regex.


Suppose I have 3 person saved in index collection as Person p1 = new Person("[a-z]", 12); Person p2 = new Person("amit.*", 12); Person p3 = new Person("*rup*", 12);


Person class have name and age attributes.


you can observe name is saved as a regex value, so if I want to find a person whose name is "amitshahrupa", it should return all person objects p1, p2, p3



How can I achieve it using CQEngine query? I know QueryFactory.matchesRegex but it takes the input as regex but in my case my input is a complete String but in the index collection I have regex in name attribute. thanks in advance. I am using 3.0.0 release of CQEngine.

Regards,
Kishor
Reply all
Reply to author
Forward
0 new messages