I cannot figure out how to change every nth row in space.
I have this regex code to change all line breaks to spaces:
this.value.replace(/\n/g, ' ');
It changes everything, but it must change every line break except the third, for example:
These lines should be changed to:
- line1 line2 li3
- li4 li5 li6
What regular expression should be used to get these results?
Simon source
share