Hi Ben,

On Fri, Jul 16, 2021 at 9:57 AM Benjamin Kalish via Evergreen-dev <
[email protected]> wrote:
> I'm trying to use regular expressions in a print template, but I can't
figure out what
> is supported. replace() is clearly supported for strings, because
> {{ "catalog".replace("alog","s"); }} gives cats, but all my attempts with
regular
> expressions have failed, whether I use RegExp() or the slash notation.
>
> Is there a way to use regular expressions in print templates? They would
be oh so useful here!

Unfortunately, the AngularJS expressions that those print templates use
explicitly do not support regexp literals.

However, it would be a matter of just a few lines of code to make Evergreen
define a custom filter implementing a regexp replace function that could be
made available to the print templates, a la
https://embed.plnkr.co/plunk/8LDJXj.

Regards,

Galen
--
Galen Charlton
Implementation and IT Manager
Equinox Open Library Initiative
[email protected]
https://www.equinoxOLI.org
phone: 877-OPEN-ILS (673-6457)
direct: 770-709-5581
_______________________________________________
Evergreen-dev mailing list
[email protected]
http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-dev

Reply via email to