- Sep 13, 2001
- 53,582
- 6,424
- 126
i am okay with some basic regex and will just look at a regex cheat sheet (http://www.cheatography.com/davechild/cheat-sheets/regular-expressions/) but I am having problems trying to figure this out.
what i have is a multiline string like the following (note the white space before/after the terms on each line)
then take this modified version of the above with no white before/after each term
i'm looking to write a regex that will match the first one because it finds white space before/after each new line (don't worry about the initial/trailing white space in that string, because a .trim() handles that).
i'm having trouble with this so looking for some help. anyone?
what i have is a multiline string like the following (note the white space before/after the terms on each line)
Code:
this is one term
another term
only one space
then take this modified version of the above with no white before/after each term
Code:
this is one term
another term
only one space
i'm looking to write a regex that will match the first one because it finds white space before/after each new line (don't worry about the initial/trailing white space in that string, because a .trim() handles that).
i'm having trouble with this so looking for some help. anyone?