Monday 17 June 2019

crawler-request regex

Im getting text from a pdf with a package called crawler-request.for some reason the simple regex that I apply to the string to remove all newlines (/n):let fixed = response.text.replace(/\n/g, " "); doesnt remove all newlines and creates a mess with tons of newlines left ...If I take the same string from console log & paste it into a online tool apply the same regex ... it works like charm... https://regex101.com/r/O4D9hM/5what is going on here ?????? does node.js have some kind of different regex ????This is the messed up version ... same command like in the online toollet fixed = response.text.replace(/\n/g, " "); https://regex101.com/r/O4D9hM/6

Submitted June 17, 2019 at 10:25PM by MedyGames

No comments:

Post a Comment