79078032

Date: 2024-10-11 11:36:04
Score: 2.5
Natty:
Report link

Please note that every trivial solution that does not reverse the string and pattern will fail in the edge case of overlapping patterns. Let's say you have the string "01-02-03" and you want to find the last match of "\d{2}-\d{2}". Using findall/finditer with [-1] will NOT return "02-03" but "01-02".

(To get a solution that does not reverse the string, all overlapping patterns must be in the results, then the [-1]-method does work.)

(As I do not have enough reputation to leave a comment, I have to leave an answer instead.)

Reasons:
  • RegEx Blacklisted phrase (1.5): I do not have enough reputation
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: just_a_random_name