An old macro stopped working

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
sk2107
Posts: 325
Joined: Sun Aug 07, 2022 8:48 pm

An old macro stopped working

Post by sk2107 »

Hello,

viewtopic.php?p=63358&hilit=lpp#p63358

In this previous post I defined the 2 suggested macros: fpp (first part in path) and lpp (last part in path) and they where working fine, I did not use them for sometime but today I needed them, the macro fpp worked fine but the lpp returns an empty results

I tried multiple values as parameters lpp:1, lpp:2, lpp:3 .... etc) but the same

Any ideas what could be the problem?

Thank you
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: An old macro stopped working

Post by void »

addcolumn:a a-label:="Last $param: path parts" a:=regexextract($path:,"(?:[^\\]*(\\|$)){$param:}$")
There was a fix to how REGEXEXTRACT works.

(?:...(...)...) will set match 1

Wrap the whole regex pattern in a capture group:

addcolumn:a a-label:="Last $param: path parts" a:=regexextract($path:,"(([^\\]*(\\|$)){$param:})$")


-or-

addcolumn:a a-label:="Last $param: path parts" a:=regexextract($path:,"(?:[^\\]*(?:\\|$)){$param:}$")
sk2107
Posts: 325
Joined: Sun Aug 07, 2022 8:48 pm

Re: An old macro stopped working

Post by sk2107 »

It worked.

thanks a lot.

Best regards
Post Reply