Database Regex search for a substring repeated x times

I’m searching a Valentina db for a field containing the pattern of two consecutive newlines. I’d like it to return true only if the pattern is repeated a certain number of times. I thought this search would find the pattern if it was present two or more times, but it’s not working.

SELECT * FROM thetable WHERE thefield REGEX ‘[


Anyone have a solution?

I’m not sure I understand. Are you looking for text where there are consecutive newlines present at least twice in the string, something like this:

this is line 1

This text would not match since there is only one occurrence of consecutive newlines
this is line 1

this is line 2

This text *would* match


Yes, that’s exactly what I’m looking for.

The pattern would be something like this:


Thanks, that does work in RegExRx, but not in Valentina, which uses the IBM ICU library. Let me look into their syntax a little bit.

I tried to generalize it, but implementation differences do come up, unfortunately.