There is an example to translate this regex in (modern) javascript and split parts :
const splitRegex = new RegExp(/(?:\|\||[^\|])+/g)
function splitChoices(message) {
const matchResult = message.match(splitRegex)
const parts = [...matchResult] // Convert iterable to an array
// unescape pipes in parts
return parts.map((result) => result.replaceAll('||', '|'))
}
Hello,
Do you think, it is possible to manage escaping the pipe characters in pluralization ? This issue has been fixed in Symfony here : https://github.com/symfony/symfony/pull/17662
There is an example to translate this regex in (modern) javascript and split parts :
Thanks for this great library!