Thanks, Galen, How would I get a custom filter like this into a template?
Benjamin Kalish Forbes Library / 413-587-1012 / [email protected] Support Forbes Library: - Consider giving a gift <https://forbeslibrary.org/giving/donate-online/> to Forbes Library - Vote for the Friends of Forbes in the Florence Bank Community Grant Program <https://www.florencebank.com/vote>. - Join the Friends of Forbes today <https://forbeslibrary.org/friends/>! Currently reading:* The Sellout *by Paul Beatty Just Finished: *First Person Singular* by Haruki Murakami For information about accessibility at the library, please see: http://forbeslibrary.org/accessibility/ On Fri, Jul 16, 2021 at 3:45 PM Galen Charlton <[email protected]> wrote: > 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
