Reading a line backwards

Posted by Jimmy on Stack Overflow See other posts from Stack Overflow or by Jimmy
Published on 2010-05-03T00:11:20Z Indexed on 2010/05/03 0:17 UTC
Read the original article Hit count: 221

Filed under:
|

Hi,

I'm using regular expression to count the total spaces in a line (first occurrence).
match(/^\s*/)[0].length;

However this reads it from the start to end, How can I read it from end to start.

Thanks

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about regex