She said s(he) be(lie)ve(d), he said sbeve.
- A non-empty string,
s. It's guaranteed that
swill have only printable ASCII characters and at least one word (defined as
[A-Za-z0-9]+) in parentheses, and all parentheses will be closed respectively.
- A string containing all non-whitespace characters (whitespaces are defined as spaces, tabs, carriage returns, new lines, vertical tabs and form feeds characters) that are not in parentheses.
Input -> Output s(he) be(lie)ve(d) -> sbeve s(h3) (1s) br(0k)3n -> sbr3n (I) (K)now (Ill) Be (My) Best (Self) -> nowBeBest sho(u)lder (should)er s(ho)u(ld)er s(h)ould(er) -> sholderersuersould p(er)f(ection) -> pf (hello) (world) ->
The last output is an empty string.
This is code-golf so shortest code in bytes wins.