Summary
the regex() operator in the citation key generator is not handling character classes ([<characters>]) correctly.
JabRef Version
JabRef version 5.1--2020-08-30--e023aa0 on Windows 10 10.0 amd64 with Java 14.0.2
Description
When the regular expression in the regex() operator includes a character class ([<characters>]), the operator returns an empty string instead of replacing matched expressions with the replacement string.
Steps to reproduce the behavior:
Consider this entry:
@Article{gilligan:2020:Wickedness.ManagingComplex,
author = {Gilligan, Jonathan M. and Vandenbergh, M. P.},
date = {2020},
journaltitle = {Vanderbilt Law Review},
title = {Beyond Wickedness: Managing Complex Systems and Climate Change},
}
- Set the default citation key generator expression in Options/Preferences to
[auth:(anon):lower]:[year:lower]:[shorttitle:regex(":+",".")]
and leave the generators for specific types blank.
- Regenerate the key. It gives the key as above:
gilligan:2020:Wickedness.ManagingComplex,
- Now change set the default key generator expression in Options/Preferences to
[auth:(anon):lower]:[year:lower]:[shorttitle:regex("[:]+",".")]
or
[auth:(anon):lower]:[year:lower]:[shorttitle:regex("[^A-Za-z0-9]+",".")]
- Regenerate the key again. It gives
gilligan:2020: (the title portion is empty).
When I look at the JabRef event log, it's empty.
Summary
the
regex()operator in the citation key generator is not handling character classes ([<characters>]) correctly.JabRef Version
JabRef version 5.1--2020-08-30--e023aa0 on Windows 10 10.0 amd64 with Java 14.0.2
Description
When the regular expression in the
regex()operator includes a character class ([<characters>]), the operator returns an empty string instead of replacing matched expressions with the replacement string.Steps to reproduce the behavior:
Consider this entry:
gilligan:2020:Wickedness.ManagingComplex,gilligan:2020:(thetitleportion is empty).When I look at the JabRef event log, it's empty.