[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] combining python regex with QPlainTextEdit?
From:       David Cortesi <davecortesi () gmail ! com>
Date:       2011-07-28 2:41:42
Message-ID: CALyzANs2U6NMBkJnds0-PD4PB-t=Cn7ZPaV=y+4OFq7gLu7DWQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


This is a high-level design question. I'm looking at writing a PyQt-based
replacement for an old app written in Perl/TCL. It is basically a
specialized text editor and QPlainTextEdit would be a nifty basis with one
exception: regex find/replace.

The old app fully exposed Perl regex syntax in its Find/Replace dialog, and
the small user community is used to complex regex-based global changes. So a
new app needs to offer regex function at least as good as Perl's. This does
not describe QRegExp. But the regex module from pypi is as good as Perl,
esp. for UTF-8 files which these are.

The question is: in general terms how feasible would it be to provide
Python-regex based Find/Replace when the document is held in and mostly
edited through a QPlainTextEdit? Is it practical to work back and forth
between the world of QTextCursors and the world of Python u"string" values?
In high level terms, how would one implement a regex Find, followed by a
Replace-and-Find-Next?

Thanks for any insights,
Dave Cortesi

[Attachment #5 (text/html)]

This is a high-level design question. I&#39;m looking at writing a PyQt-bas=
ed replacement for an old app written in Perl/TCL. It is basically a specia=
lized text editor and QPlainTextEdit would be a nifty basis with one except=
ion: regex find/replace.<br>

<br>The old app fully exposed Perl regex syntax in its Find/Replace dialog,=
 and the small user community is used to complex regex-based global changes=
. So a new app needs to offer regex function at least as good as Perl&#39;s=
. This does not describe QRegExp. But the regex module from pypi is as good=
 as Perl, esp. for UTF-8 files which these are.<br>

<br>The question is: in general terms how feasible would it be to provide P=
ython-regex based Find/Replace when the document is held in and mostly edit=
ed through a QPlainTextEdit? Is it practical to work back and forth between=
 the world of QTextCursors and the world of Python u&quot;string&quot; valu=
es? In high level terms, how would one implement a regex Find, followed by =
a Replace-and-Find-Next?<br>

<br>Thanks for any insights,<br>Dave Cortesi<br><br>


_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic