How to split a string on the first occurrence of one of multiple substrings in JavaScript?

Matches just enough characters to match the next part of the RE, which is (foo|bar) either "foo", or "bar" \S\s* matches the remaining characters Parentheses around a part of a RE creates a group, so that the grouped match can be referred, while (?:) creates a non-referrable group.

This works and is well explained. In the end I needed to match the last occurrence and get the splitting string back, so I did /^(\S\s*)(foo|bar)(\S\s*? )$/.

Thank you. – Marek Miettinen Sep 23 at 12:19.

Str. Replace(/foo|bar/,"\x034"). Split("\x034") idea is replace the first occurrence with a special(invisible) String, and then split against this string.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions