Closed Linguista closed 4 years ago
Hi @Linguista, There were an earlier version with a bug in the regex modifier that occurred with space after ,
and the empty replacement ""
. Could you try regex("Del","_")
instead?
You can try a more recent development build at https://builds.jabref.org/master/ , just make sure to backup your library beforehand.
Hi @Linguista, There were an earlier version with a bug in the regex modifier that occurred with space after
,
and the empty replacement""
. Could you tryregex("Del","_")
instead?
Thanks very much -- you hit the nail on the head. Both the space between the regex fields and an empty replacement string break the citation generation on any field that has them. I can avoid the space, but adding garbage strings to citation keys obviously isn't idea.
Fortunately, the latest dev version fixes the error.
If I may ask a follow-up question, there seems to be no way to add stop/function words to the built-in English-only list of them that JabRef comes with. So I'm trying to do the same thing with the regexes in the citation key generator. But it seems that the non-word code, \W
, doesn't work. Nor does the escaped version, \\W
. Is this wrong, or is this a bug?
but adding garbage strings to citation keys obviously isn't idea.
While not ideal, if you are worried about using the dev version you can use the "Replace (regular expression)" feature to later remove the garbage string.
Nor does the escaped version,
\\W
. Is this wrong, or is this a bug?
\\W
appears to works for me. Could you give an example of how you are using it?
I'd not expect it to be used it for that purpose. Does something along the lines of (\\bword\\b)
work? (example is from https://www.regular-expressions.info/wordboundaries.html)
there seems to be no way to add stop/function words to the built-in English-only list of them that JabRef comes with.
I don't think there is, but it could perhaps be an idea for a new issue with this as a feature request? (I have never used JabRef for non-english citations, I don't know how useful this is to others)
Nor does the escaped version,
\\W
. Is this wrong, or is this a bug?
\\W
appears to works for me. Could you give an example of how you are using it? I'd not expect it to be used it for that purpose. Does something along the lines of(\\bword\\b)
work?
Yes! \\b" is exactly what I needed... with one addition. I'm searching on lowercase words but I had the
capitalize` command right before it, which was making everything fail!
Duh!
Thanks so much for your help.
So if I understood this correctly, this issue is solved in the latest development version and you also have a custom solution.
JabRef version 5.1 on Kubuntu 20.04
Any use of a regex in Options > Preferences > Citation key generator > Key Patterns > Key Pattern produces an empty field.
Steps to reproduce the behavior:
[authEtAl][year][shorttitle:capitalize
][authEtAl][year][shorttitle:capitalize:regex("Del", "")]
In this case, the generated field consists only of
authEtAl
andyear
.shorttitle
is empty.