Handlebar help with substring

Is it possible to strip the first and last character off of a string using a Handlebar expression? I have a product code of "BQ24-00000123542N" that I want to be "Q24-000001233542".

Or does this require javascript?

hi, it is possible using regex. Assuming simple structure such as {"productCode": "abba"},

the following should do the job: {{regexReplace productCode "" "^.|.$" "gm"}} and output is "bb".

More info here: https://docs.celigo.com/hc/en-us/articles/360039326071-Handlebars-helper-reference

I'm by no means a regex expert but this is a useful resource for testing: https://regex101.com/

You could also do this

{{substring (substring code 1) 0 (subtract code.length 2)}}