Your regex causes catastrophic backtracking (see a demo of your regex here) due to (([\u00C0-\u1FFF\u2C00-\uD7FF]+[^a-z\u00C0-\u1FFF\u2C00-\uD7FF]*)+)
part. As [^a-z\u00C0-\u1FFF\u2C00-\uD7FF]*
can match zero characters, you basically have a classical (a+)+
-like pattern (cf: ([\u00C0-\u1FFF\u2C00-\uD7FF]+)+
) that causes backtracking issue.
To get rid of it, you need to make sure the subpatterns are compulsory inside the grouping, and apply a *
quantifier to the whole grouping:
^([\u00C0-\u1FFF\u2C00-\uD7FF]+(?:[^a-z\u00C0-\u1FFF\u2C00-\uD7FF]+[\u00C0-\u1FFF\u2C00-\uD7FF]+)*) [a-z]+[^\u00C0-\u1FFF\u2C00-\uD7FF]*$
See regex demo
Here, [\u00C0-\u1FFF\u2C00-\uD7FF]+(?:[^a-z\u00C0-\u1FFF\u2C00-\uD7FF]+[\u00C0-\u1FFF\u2C00-\uD7FF]+)*
matches:
[\u00C0-\u1FFF\u2C00-\uD7FF]+
- one or more character from [\u00C0-\u1FFF\u2C00-\uD7FF]
ranges
(?:[^a-z\u00C0-\u1FFF\u2C00-\uD7FF]+[\u00C0-\u1FFF\u2C00-\uD7FF]+)*
- zero or more sequences of:
[^a-z\u00C0-\u1FFF\u2C00-\uD7FF]+
- one or more characters other than those from the a-z\u00C0-\u1FFF\u2C00-\uD7FF
ranges
[\u00C0-\u1FFF\u2C00-\uD7FF]+
- one or more characters from the \u00C0-\u1FFF\u2C00-\uD7FF
ranges.