Thursday, 19 September 2013

Javascript:JSllint regular expression literal can be confuse with /=

Javascript:JSllint regular expression literal can be confuse with /=

I have wrote some javascript to split string if "=" sign is there
For example. key=value string="id=abc=xyz" In the above example I have to
split string base on "=" sign, and store them into key and value pair. In
this example I am going to store key as "id" and value as a "abc=xyz". to
split this I have added following code to store value. It working fine.
but my Jslint says "regular expression literal can be confuse with /=".
var value=string.split(/=(.+)/)[1];
Any pointer for this.

No comments:

Post a Comment