Using JDO with Datanucleus, I'm trying to filter some data from my database (using jdoql). I would like to use the regular expression for some sophisticated searchs, I found that JDO provide the String method "matches" that accepts a regular expression, and according to the DATANUCLEUS documentation, this method can receive any type of ExpReg:
matches(String pattern) : Returns whether string matches the passed expression. The pattern argument follows the rules of java.lang.String.matches method.
I was able to do filtering based on some regular expression (like " .* ", ".", ". * ") But not with others (like [abcd])
Can someone confirm that not all the set of regular expression syntax are supported ??
Query q = pm.newQuery(cl, "this.name.matches(filterName)");
q.declareParameters("String filterName");
List results = (List)q.execute("Bo.*");
return pm.detachCopyAll(results);
--> Return Book, Book2
But with : q.execute("B[aoe]ok") return nothing !
Thanks