Forum Academy Marketplace Showcase Pricing Features

Bad regex safari find & replace

Hi,

I would like to find and replace the end of a multi-input field (after “Bonjour” using regex). It works well with Chrome but since Safari does not support lookahead/behind I got this error on this browser : “bad regex format : invalid regular expression: invalid group specifier name”

The regex I use :
(?<=Bonjour).*$

image

Thanks

Check this out

I think your expression may be off.

https://extendsclass.com/regex/6bff28d

Thanks for your reply.
It works well on Chrome, and on the test site you sent me
image

The problem is that lookbehind & lookahead are not supported in Safari

Found the solution, quite complex though :

\b([^B]|B(B|o(B|n(B|nB)))([^Bo]|o([^Bn]|n([^Bj]|j([^Bo]|o([^Bu]|u([^Br])))))))(B(B|o(B|n(B|nB)))*(o(n?|jour))?)?$