Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: p.findall #15

Closed
GoogleCodeExporter opened this issue Mar 24, 2016 · 5 comments
Closed

Feature request: p.findall #15

GoogleCodeExporter opened this issue Mar 24, 2016 · 5 comments

Comments

@GoogleCodeExporter
Copy link

I just started trying out pyp and one feature that I was very surprised to find 
missing was a wrapper around re.findall. Currently, there doesn't seem to be an 
easy way of getting all instances of a match of a regular expression, and that 
would be really nice for combining with p.kill.

Original issue reported on code.google.com by dan.blan...@gmail.com on 4 Jun 2012 at 7:54

@GoogleCodeExporter
Copy link
Author

I apologize for reporting this as a defect, but I couldn't seem to find a way 
to report it as anything else.

Original comment by dan.blan...@gmail.com on 4 Jun 2012 at 7:55

@GoogleCodeExporter
Copy link
Author

sounds interesting...we'll add this feature when we get a chance.

t

Original comment by tobyro...@gmail.com on 6 Jun 2012 at 6:06

@GoogleCodeExporter
Copy link
Author

I might add a p.rekill(REGEX) and p.rereplace(REGEX) instead...can you think of 
other ways the matches might be useful?

thanks,

t

Original comment by tobyro...@gmail.com on 5 Sep 2012 at 6:51

@GoogleCodeExporter
Copy link
Author

Providing a p.findall(REGEX) would let you do things like extract every email 
address on a line as a list (which you could then process with a list 
comprehension however you wanted). I think it would be extremely useful.

I think p.rekill and p.rereplace would be extremely useful for cases where you 
want to modify subsections of the line while leaving the rest intact, but 
p.findall would be a nice flexible solution for when you only want to keep the 
parts of the line that match the regex and operate solely on those.

Original comment by dan.blan...@gmail.com on 5 Sep 2012 at 7:06

@GoogleCodeExporter
Copy link
Author

we've added these functions. this was an excellent suggestion, thank you!


http://code.google.com/p/pyp/

Original comment by tobyro...@gmail.com on 26 Mar 2014 at 9:56

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant