Menu

#113 search/replace with non-capturing regex

v1.0.26
open
nobody
None
5
2014-08-26
2013-09-01
Anonymous
No

In versions 1.0.23-1.0.25 a bug exists which is illustrated by, but not limited to, the attached example.

I'm trying to use GG regex to change code like this:

<li>Decussated, ‹303›.</li>

<li>‹Delesseria›, 77, 79, 86.
‹D. alata›, 77, 86.
‹D. Leprieurii›, 77, 86.
‹D. sinuosa›, 77, 86.</li>

<li>‹Delesserieæ›, 77, ‹85›.</li>

to this:

<li>Decussated, ‹303›.</li>

<li>‹Delesseria›, 77, 79, 86.
<ul><li>‹D. alata›, 77, 86.</li>
<li>‹D. Leprieurii›, 77, 86.</li>
<li>‹D. sinuosa›, 77, 86.</li></ul></li>

<li>‹Delesserieæ›, 77, ‹85›.</li>

The following multiline regex works in Notebook++, but
not in GG 1.0.23-1.0.25.

S "^([‹\w][^\n]+?\.)(?=[\n<])"
R "<ul><li>$1</li>"
R "<li>$1</li>"
R "<li>$1</li></ul>"

I believe this is a bug that reallllly needs to be fixed. A similar problem has shown up before in another context, see http://www.pgdp.net/phpBB2/viewtopic.php?p=918355#918355

I believe this is a bug that really needs to be fixed. A similar problem has shown up before in another context, see http://www.pgdp.net/phpBB2/viewtopic.php?p=918355#918355

1 Attachments

Discussion

  • hannne

    hannne - 2013-09-21

    Ticket moved from /p/guiguts/bugs/86/

     
  • hannne

    hannne - 2013-09-21

    In versions 1.0.23-1.0.25 a bug exists

    What does that mean? It works in earlier versions, or you haven't tried any earlier versions? Probably the latter, but please be clear.

    Notebook++

    Assuming this means Notepad++... Different editors have different features, and you shouldn't expect that Guiguts can do anything some other editor can do.

    As far as I know, Guiguts doesn't claim that it can handle non-capturing regexes when replacing, nor does it try to do so, so I don't see any bug (unless the documentation claims this functionality, in which case the documentation should be updated), but it's a reasonable feature to wish for. A possible "fix" would be to remove support for non-captures in searching as well to increase consistency and reduce confusion, but removing a feature is rarely popular...

    To increase the chance of this feature being added, someone should provide a detailed description of what's desired, along with one or more minimal examples to illustrate. Not assuming the reader to possess anything beyond basic regex skills is probably a good starting point.

     
  • tcosmas

    tcosmas - 2013-09-30

    Hanne,

    Please DO NOT remove non-capturing search ability. GG should move FORWARD not BACKWARDS! Please just correct the code (if possible) in the "Replace" processing module!

    Thanks, Tom

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB