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
Document the regular expression replacement character #2439
Comments
It is documented in the manual:
Maybe it needs to be called-out more, since the GLib docs don't do a good job either. |
Yeah, glib documents it on the replace function https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-regex-replace not in the regex syntax section so its not that obvious. |
Thanks for pointing that out. I did not consider "replace" or "replacing" as a search keyword - I was looking for "replacement" and "substitution". How about splitting the list up into characters used in the match, and characters used in the replacement, with separate headers? |
May I also suggest replacing (And maybe it is a good idea to add a note in the documentation highlighting that |
It may be a little subtle, but the regex syntax is Perl compatible, (and it is also yuckmascript compatible if a flag is set, Geany doesn't set it) but replacement isn't part of the regex syntax and thats why it isn't documented in the Glib regex syntax page. My reference to Glib's replace is irrelevant, it appears that the replace is Geany's own so its totally unrelated to any Perls, so yeah, it should be clearly documented in Geany docs. Why the Geany docs repeat the regex stuff I'm not sure, but I think its from back when it used a less common regex engine, but thats where the replace stuff is hidden, maybe it should be here. Pull requests are welcome. |
It took me quite a while to guess that the replacement character for Search & Replace is not
$1
or\\1
but\1
. STFW came up empty, since most questions are about problems with the pattern, not with the replacement/substitution character.I think this should be documented somewhere on https://www.geany.org/manual/gtk/glib/glib-regex-syntax.html or
<local_path>/doc/geany/html/index.html#regular-expressions
.The text was updated successfully, but these errors were encountered: