Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #76497
| From | Christian Gollwitzer <auriocus@gmx.de> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: PyMatch Tool. |
| Date | 2014-08-18 19:38 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <lstdnd$mab$1@dont-email.me> (permalink) |
| References | <198ac789-f8e3-4f81-b10f-d7b29c25a70f@googlegroups.com> <lslsbg$qqt$1@dont-email.me> <36bc5245-ebbf-4358-9b8e-1f5ef58ff0d7@googlegroups.com> |
Am 18.08.14 14:21, schrieb Rafael Francischini: > Em sexta-feira, 15 de agosto de 2014 17h59min28s UTC-3, Christian Gollwitzer escreveu: >> >> I expected something like visual regexp: >> http://laurent.riesterer.free.fr/regexp/ >> >> Since RegExp-Syntax is very similar across tools, yours is almost >> >> identical to grep. Is it not? >> >> >> >> Christian > > Hi Christian, it is quite similar. > The difference is with her can extract and use the values stored in groups. > I guess you haven't tried visual regexp. It marks the regexp parts and what it matches with distinct colors - Look at the screenshot. The C++-code looks like syntax highlighting. But visual regexp does the coloring automatically just by looking at the regexp. For example, the word "template" is colored blue, because it was matched by \w+ (also colored blue in the expression). Your tool seems to only extract pure text. This can be done using sed, e.g.: sed 's/(.* some re)/place \1 here/' The \1 is replaced with the first () group, \2 with the second etc. From within Python, you can use re.sub, which also accepts backreferences. Christian
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
PyMatch Tool. rafinha.unix@gmail.com - 2014-08-14 12:50 -0700
Re: PyMatch Tool. Chris Angelico <rosuav@gmail.com> - 2014-08-15 08:49 +1000
Re: PyMatch Tool. Skip Montanaro <skip@pobox.com> - 2014-08-14 19:31 -0500
Re: PyMatch Tool. Christian Gollwitzer <auriocus@gmx.de> - 2014-08-15 22:59 +0200
Re: PyMatch Tool. Rafael Francischini <rafinha.unix@gmail.com> - 2014-08-18 05:21 -0700
Re: PyMatch Tool. Christian Gollwitzer <auriocus@gmx.de> - 2014-08-18 19:38 +0200
Re: PyMatch Tool. Rafael Francischini <rafinha.unix@gmail.com> - 2014-08-18 13:14 -0700
csiph-web