Wim Koomen wrote: > Basically I'm having some problems using the list taglib on > MMBase. I'm trying to get groups.name's that start with either 'A' or > 'a'. To accomplish this I want to use the following constraint. > constraints="groups.name MATCHES '[Aa]*'"
I would do it with: <mm:constraint field="groups.name" operator="LIKE" value="a%" /> which is case-insensitive anyhow, IIRC. Regexps are not supported by the query-layer, although I got it working once, but never checked it in, that's probably the reason why you tried to do it with the constriants attribute. > However, when I look in my log file and see how MMBase writes my query > the constraint gets rewritten and looks as follows: > > groups.name MATCHES 'Aa*' > It seems somewhere in MMBase the square brackets get stripped from the > constraint. Which results in the database trying to match exactly 'Aa' > as the first characters instead of using Aa in the form of a character > class. > > Why does MMBase strip the square brackets? And if it does strip them > for a reason does anyone have a suggestion on how to elegantly fix > this? This is not done by the taglib, but by the query-layer I suppose, because []-brackets are used to escape fields. Perhaps it should not do that inside quotes, and/or wheter what it escapes is no field. Michiel -- Michiel Meeuwissen mihxil' Mediacentrum 140 H'sum [] () +31 (0)35 6772979 nl_NL eo_XX en_US _______________________________________________ Developers mailing list [email protected] http://lists.mmbase.org/mailman/listinfo/developers
