Ok guys, I\'m having a hard time with regex..
Here\'s what I need... get a text file, remove all blank lines and white spaces in the beginning and end of these lines
Since it sounds like you have to do this all in a single regex, try this:
quotes.replace(/^(?=\n)$|^\s*|\s*$|\n\n+/gm,"")
What we are doing is creating a group that captures nothing, but prevents a newline by itself from getting consumed.