this regex /(?<=.+)(\n|\r|\n\r|\r\n){1,}/g works for major browser but is breaking on safari. Is there any alternate for the same?
Asked
Active
Viewed 30 times
0
-
may be this will help you to https://stackoverflow.com/questions/58460501/js-regex-lookbehind-not-working-in-firefox-and-safari – Mohit Sharma Jul 01 '22 at 05:02
-
`(?<=.+)` = `(?<=.)` = `(?!^)` – Wiktor Stribiżew Jul 01 '22 at 08:13
-
If you need to replace, eg. [capture](https://www.regular-expressions.info/brackets.html) like this: [`(.)[\r\n]+` and replace with `$1`](https://regex101.com/r/neDPyJ/1) if you need to extract the *crlf* part: [`.([\r\n]+)`](https://regex101.com/r/BlgoJp/1) - and if you just need to match, even [`.[\r\n]`](https://regex101.com/r/KGCoIS/1) could suffice. It's essential to know about the context, the regex is used. – bobble bubble Jul 01 '22 at 10:13