Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • yes - but I need the data to be structured like an array. In further functions I have to access like that: var X = pt[2].x; I am looking for an easy way to convert data... Commented Dec 1, 2012 at 18:33
  • I added the example of converting Commented Dec 1, 2012 at 19:03
  • Hi - thanks that worked - could you explain how the pattern var works? Commented Dec 1, 2012 at 19:22
  • This is a very long discussion. pattern is Regular expression that describe what kind of strings we want. This pattern say that we want strings that begins with pt then [ then more then one symbol that aren't ] then ] and then one more time, $ is end of line. There are 2 functions for working with regular expressions: test - check that our string is in language that create pattern. match - will parse string into array 0 element is whole string, 1 parametr is all symbols in first () and 2 in second. You can read more here w3schools.com/jsref/jsref_obj_regexp.asp Commented Dec 1, 2012 at 19:33