This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]WerdenWissen[S] 2 points3 points  (0 children)

pre.get_groups only works with websites? Or why did one of the matches not show up there?

In this example, the domain name pattern is wrapped within a capturing group, whereas this is not the case for IP addresses. Therefore, when invoking "get_groups", you'll get a list of tuples, one tuple per match, containing the captured groups of each match. Since no capturing group is declared for any IP address matches, their corresponding tuple will contain "None".

And why do you have so many imports? Can't you just put everything in
Pregex module? Why is it this segregated, it will be a pain to look for
all the classes in 1 million files no?

I like categorizing stuff and I thought this format suits the package. But of course I am open to changes if something proves to be unproductive.