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
  • 2,194
  • 2
  • 23
  • 55

1 Answers1

1

So the following ended up being the javascript equivalent:

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

Thanks for the helpful comments

Maxqueue
  • 2,194
  • 2
  • 23
  • 55