Prosemirror-search asymmetry with regular expressions

Suppose the text in your editor is “an example text”.

Now start a regex search for /[a-z][a-z]+/.

If you start with the cursor at the beginning of the text, findNext will select “an”, then “example”, then “text”.

Suppose your selection is now on the last word “text”. Calling the findPrev command, the selection moves over “le” of “example”. Calling findPrev again, the selection moves over “mp” of “example”, and so on.

You may expect to see the selection go over “example” and then “an” instead.

That is not necessarily wrong, indeed it’s consistent with the regexp used to search; the ‘+’ quantifier accumulates on the right, not on the left.

You may search for /\b[a-z][a-z]+/ to fix it, but the asymmetry, between the ranges you select moving forward and the ones you see going backwards, looks a bit weird anyway.