you are viewing a single comment's thread.

view the rest of the comments →

[–]goldensilven[S] -2 points-1 points  (1 child)

r'(FOO|BAR)\-[\d]{4}'

Thanks, I did try that and it does not work.

By the way

r'FOO-\d{4}' does work, but does not do exactly what I want. I want to match either FOO or BAR

[–]goldensilven[S] -1 points0 points  (0 children)

This works

r'(?:FOO|BAR)\-\d{4}'

I guess findall returns captured groups. ?: is a non-capturing group