3

I have a silverlight application that i am converting to html5. I have this piece of code in c# that i am having trouble converting to javascript equivalent.

C#:

private const String DELIMITERS = @"(?=[,'\s])|(?<=[,'\s])";
string[] searchList = Regex.Split(MainTextArea.Text, DELIMITERS);

This is what i have tried in javascript but it's not splitting text.

javascript:

var searchList = $input.val().split("(?=[,'\\s])|(?<=[,'\\s])");

Thanks for any help in advance.

Maxqueue
  • 1,803
  • 1
  • 18
  • 46

1 Answers1

1

So the following ended up being the javascript equivalent:

$input.val().split(/([,'\s])+/);

Thanks for the helpful comments

Maxqueue
  • 1,803
  • 1
  • 18
  • 46