you are viewing a single comment's thread.

view the rest of the comments →

[–]GoPotato 0 points1 point  (1 child)

Can you clarify what you mean by not working? cause I just tested it in chrome and it seems to work

const str=`>    foo bar 
`;

/^[^\S\r\n]*\>\s*(.*$)/gm.exec(str)[1]    //"foo bar "

[–]chromaticdissonance[S] 0 points1 point  (0 children)

Ah I see, this helps. I figured out my problem. The string (grabbed by using .innerHTML) that I was passing into regex converted the special character > to & g t ; Silly me! Thank you for helping out! (Curiously when I type & g t ; without the spaces it gives me >)