I would like to search for any users under home/users with a first or last name that contain a non-alphanumeric character. I've tried the following SQL2 but no luck:
SELECT * FROM [rep:User] AS user WHERE ISDESCENDANTNODE([/home/users]) AND [profile/familyName] is not null AND [profile/familyName] LIKE '%[^a-zA-Z0-9]%' AND [profile/givenName] is not null ORDER BY [profile/familyName]
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @stiegjo, JCR query is not supporting regular expression. Some operators supports wild cards e.g.
In your case I would simply use query to get all users and as a next step do the filtering on Java level.
You can also try to build a query that will check if specific (unwanted/special) char is included in givenName or familyName - so the other way around comparing to your current strategy. But I can image that this kind of query could be complex and maybe it will not give you the expected result.
Hi @stiegjo, JCR query is not supporting regular expression. Some operators supports wild cards e.g.
In your case I would simply use query to get all users and as a next step do the filtering on Java level.
You can also try to build a query that will check if specific (unwanted/special) char is included in givenName or familyName - so the other way around comparing to your current strategy. But I can image that this kind of query could be complex and maybe it will not give you the expected result.
Views
Like
Replies