On Wed, Jun 13, 2018 at 07:06:09PM +0800, Ken Hilton <[email protected]>
wrote:
> Regexes are really useful in many places, and to me it's sad to see the
> builtin "re" module having to resort to requiring a source string as an
> argument. It would be much more elegant to simply do "s.search(pattern)"
> than "re.search(pattern, s)".
pat_compiled = re.compile(pattern)
pat_compiled.search(s)
> I suggest building all regex operations into the str class itself, as well
> as a new syntax for regular expressions.
There are many different regular expression implementation (regex,
re2). How to make ``s.search(pattern)`` work with all of them?
> Thoughts?
> Sincerely,
> Ken;
Oleg.
--
Oleg Broytman https://phdru.name/ [email protected]
Programmers don't die, they just GOSUB without RETURN.
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/