Redirect StrUtils.RPos to StrUtils.RPosEx, fix a bit, improve a bit.
[rpos.patch](/uploads/c084f8d7166c6b6ba9b0ebcecea34175/rpos.patch) Continuation from #40389. Additional points: - I introduced a potential error: single-character `RPosEx(char, string, offs)` should check for `offs < 1`, like `string` versions do. - Current `(string, string)` `RPos` versions can **read the character past the first**, reinterpreting a part of the `length` field as a character. To see that, add `writeln('analyzing ', ord(pc^));` to the inner loop and search for a non-existing substring. Coincidentally, it never affects the result (even accidental match at this “position” will return “correct” 0), but agree it is ugly. If you apply this patch, close also #39463.
issue