After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 103751 - RFE: regular expressions in gedit's search and replace
RFE: regular expressions in gedit's search and replace
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on: 134674
Blocks:
 
 
Reported: 2003-01-17 15:29 UTC by Roman Polach
Modified: 2013-08-19 14:20 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Roman Polach 2003-01-17 15:29:51 UTC
Gedit: Search and Replace should support regular expressions.
Comment 1 Paolo Maggi 2003-01-17 16:10:03 UTC
This feature should be implemented as a plugin.
Comment 2 Rob Wilco 2005-04-29 22:46:50 UTC
I was just about to say it : I wish I could use regexp that feature too. Great
job though.
Comment 3 Héctor Monacci 2005-04-30 22:57:17 UTC
The day gedit gets regexps, lot of Gnome-based programmers and power users,
including myself, will abandon estetically unsatisfactory but currently more
powerful alternatives such as gvim and nedit. Keep this to-do high on the
priority list! And thank you for the program!
Comment 4 Roman Polach 2006-06-05 18:11:24 UTC
Good news!
Daniel d'Andrada has implemented regualr expression search plugin.
See http://danieldandrada.blogspot.com/
Could it be added to standard plugins pack?
Comment 5 Antonio 2007-02-15 02:27:33 UTC
I think gedit is great but I agree with the others. Why not include a regex search option? It would be useful for many people.
Comment 6 Roman Polach 2007-02-15 12:58:28 UTC
missing regular expressions in gedit is almost the only reason I must use gvim regularly, I feel RE are "basic" feature of text editor and one of the best of unix traditions.. unfortunately there is no usable *simple* text editor in gnome with RE search-and-replace feature.. so therefore gnome is still not an "easy desktop", when you are supposed to use vim too often ;)
Comment 7 Antonio 2007-02-15 22:13:26 UTC
Good points Roman. I recently migrated from Windows where my primary editors were TextPad and EditPad. Both of these programs include built-in regex search, so naturally I assumed gedit would too. I feel like gedit is a great editor, it just needs this basic feature to be complete.

Anyway, I ended up installing Daniel d'Andrada's plug-in and it works good. I just wish I didn't have to open up a separate dialog to use it :)
Comment 8 Roman Polach 2007-02-25 13:02:01 UTC
there are several points to do if starting from Daniel d'Andrada's plug-in
http://danieldandrada.blogspot.com/2006/05/regex-searches-in-gedit.html

* a regex-replace dialog
* integrate it with gedit standard search- and replace- dialogs
  or at least start it from Search menu instead of Tools menu
* ship it with standard gedit plugins package
  (it can be disabled by default to not confuse new users)
Comment 9 thefekete 2007-11-08 07:13:06 UTC
gedit is a great program and would rather use it than any crap for windows. The only thing that it needs to be perfect is regular expression support. So...

Please log my vote for regex in search and replace.
Comment 10 Philip Ganchev 2007-12-23 07:25:48 UTC
I agree, it needs to be integrated with the standard s/r or under the same menu.  Otherwise the user would have to look for it and may even forget it is available.
Comment 11 Sandy Armstrong 2008-04-23 14:27:23 UTC
There is a nice, simple regex search/replace plugin here:

http://halfhourhacks.blogspot.com/2008/03/gedit-regular-expression-plugin.html

However, I agree that this needs to be a standard feature, or at least appear in the standard dialog.  It should be as simple as adding a checkbox in the Search/Replace dialogs that says "Use Regular Expressions".

Can this be done as a plugin? (Adding a checkbox to existing dialogs and injecting search/replace logic)
Comment 12 Philip Ganchev 2008-04-23 18:20:14 UTC
I don't know, but ultimately it should not be a plugin, it should be part of the program because it is so fundamental.
Comment 13 Roman Polach 2008-04-24 07:46:47 UTC
I completely agree. The other reason is that I didn't see a regex plugin
which integrates into standard gedit's search and replace dialogs. All
plugins implement separate dialogs. The right way IMHO is to have a simple
checkbox "Use regular expresions" in standard dialogs.
Comment 14 Alexandre Prokoudine 2008-11-25 11:34:22 UTC
Regular expressions is really a basic feature. Standalone plug-ins work, but this is a totally clumsy way.
Comment 15 Urmas 2011-01-01 08:30:16 UTC
It's totally unacceptable to require users to use piece of software from a RANDOM GUY'S BLOG post from 2008 to provide basic editor functionality.

Not saying that is feature that should be built-in, but it's NOT even PACKAGED ANYWHERE!

User will think he need a piece of KDE shit Kate or text mode nano or worse to do a simple anchored text search or like!
Comment 16 Paolo Borelli 2011-01-01 10:08:06 UTC
Happy New Year to you too!
Comment 17 Ignacio Casal Quinteiro (nacho) 2011-03-03 08:55:09 UTC
So today came to my mind an idea:
1) Finish the split of the gtksourceview engine
2) Provide to add a way programatically to add some text in the analyzer to highlight it
3) Create a search engine that it is the one that will iterate over the text and highlight the text.
4) Stop using gtktextiter for searching
5) Use only this GRegex based engine for everything as it would be non blocking and it would give us also regex support.

ideas about this?
Comment 18 Teppo Turtiainen 2011-08-15 21:56:16 UTC
Do the plugins linked to above not work in gedit 3 anymore?
Comment 19 Ignacio Casal Quinteiro (nacho) 2011-08-15 22:00:03 UTC
you can use the commander plugin that it works with gedit 3.
Comment 20 Urmas 2011-08-16 14:50:26 UTC
It is GUI editor and should have proper options in GUI dialog, with syntax help and similar stuff. Command lines which add command lines and or clunky dialog boxes without any documentation whatsoever are inappropriate.
Comment 21 Teppo Turtiainen 2011-08-16 17:31:44 UTC
(In reply to comment #19)
> you can use the commander plugin that it works with gedit 3.

Is there any documentation on how to use this thing? I can't find any with Google.
Comment 22 Sébastien Wilmet 2013-08-19 14:20:55 UTC
Regex search has landed gedit. There are maybe some rough edges. Some testing would be appreciated.

For now the regex errors are not reported, but it will hopefully be done for this release.