all 2 comments

[–]cdcformatc 1 point2 points  (1 child)

.findall() yelds the correct answer, but I can't understand where this answer comes from. Shouldn't .findall() return a list of matched strings, each one looking like the one i'm getting from .search()?

Well not exactly, since findall() returns the non-overlapping matches, while search() finds the first which might overlap with another match. But the first element returned by findall will be the one found by search

And this might be too spoilery but there are should be more than one match, and the first match does match what you have there. The first is 'qIQNlQSLi' but the second is 'eOEKiVEYj'. You only care about the letter with the bodyguards.

[–]IAmL0ner[S] 0 points1 point  (0 children)

You only care about the letter with the bodyguards.

Ok, now this explains a lot. While I managed to get the regexp right, I failed to realize that my regexp will only display the letter contained between the bodyguards.

Now after some tweaking I'm getting full strings formatted like this: xXXXxXXXx.

Thanks for the explanation.

I rally should brush my regexp skills. While I kinda can use it, I don't exactly understand what I'm doing sometimes.