Regular Expression Search and Replace

34 views
Skip to first unread message

FrescoLily

unread,
Oct 6, 2020, 5:28:58 AM10/6/20
to Frescobaldi
If I am using this term in Search and Replace:
[code]
(\\\[) ([a-h][ies]{0,1}[s]{0,1}[,']{0,10}[124836]?[624.]?[8.]?) -"([IXV]{1,3})" (.{1,80}) (\\\])
[/code]
I am finding results. But I am not able to replace anyone of the results. There is no reaction, if I am hitting the replace button.

FrescoLily

unread,
Oct 6, 2020, 8:48:44 AM10/6/20
to Frescobaldi
I have this problem with Win 10 Frescobaldi 3.1.1,  3.1.2 and 2.20.0

As attachment a file, wich has search results.

Divagando_Semenzato.ly

Knute Snortum

unread,
Oct 6, 2020, 8:49:25 AM10/6/20
to fresc...@googlegroups.com
You have (I think) five different capturing groups. How are you
building your replace string? \0 matches the whole express; \1
matches the first group; \2 matches the second; and so on.

Maybe if you could post the replace string and the code you are
searching, that would be helpful.

To research a complex regex like yours, try using regex101.com:

https://regex101.com/r/CREpKX/1

---
Knute Snortum
(via Gmail)
> --
> Frescobaldi homepage: http://www.frescobaldi.org/
> Mailing list: http://groups.google.com/group/frescobaldi
> Issue tracker: https://github.com/frescobaldi/frescobaldi/issues
> ---
> You received this message because you are subscribed to the Google Groups "Frescobaldi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to frescobaldi...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/frescobaldi/20d2a39a-be3c-48fb-bec5-4fdf3ba22bb4n%40googlegroups.com.

FrescoLily

unread,
Oct 6, 2020, 9:21:25 AM10/6/20
to Frescobaldi
I had posted a code one minute before your post.

In the end I tried replacing the match just with the figure "1". No replacement.

Knute Snortum

unread,
Oct 6, 2020, 10:23:54 AM10/6/20
to fresc...@googlegroups.com
Please post the entire search string.

---
Knute Snortum
(via Gmail)

On Tue, Oct 6, 2020 at 6:21 AM 'FrescoLily' via Frescobaldi
> To view this discussion on the web visit https://groups.google.com/d/msgid/frescobaldi/c755eb9d-676d-4bc3-8baa-6803137e9774n%40googlegroups.com.

FrescoLily

unread,
Oct 6, 2020, 10:26:35 AM10/6/20
to Frescobaldi
It is the same like in the first posting.

(\\\[) ([a-h][ies]{0,1}[s]{0,1}[,']{0,10}[124836]?[624.]?[8.]?) -"([IXV]{1,3})" (.{1,80}) (\\\])


FrescoLily

unread,
Oct 7, 2020, 3:53:47 AM10/7/20
to Frescobaldi
Playing around, I figured out search terms  like

.* (\\\])
 (.*) (\\\])
 (.{1,80}) (\\\])  

cause this problem. There is no replacement of the matches possible, if the match is more than one line.


But I can replace the matches of the search of (\\\])  
Reply all
Reply to author
Forward
0 new messages