How do i write a regex to replace <br /> or <br> with \n. I’m trying to move text from div to textarea, but don’t want <br>‘s to show in the textarea, so i want to replace then with \n.
How do i write a regex to replace <br /> or <br> with \n
Share
or using jQuery:
example
edit: added
iflagedit2: you can use
/<br[^>]*>/giwhich will match anything between thebrandslashif you have for example<br class="clear" />