Closed benibela closed 8 years ago
Okay, I'll try to fix that in the next minutes or hours.
Changed/improved in lastest commit, but keep it in mind, that FLRE's Split behaviour is now like ECMAScript/JavaScript's String.split and not PHP's preg_split.
So now it is supposed to insert the captures in the splitted array ? That is not what I need either :(
For example:
splitting a#b#c#d by regex # => ['a','b','c','d'] splitting a#b-c#d- by regex #(\w*)- => ['a','b','c','d']
Just read your favorite ECMAScript/JavaScript reference on the String.split() topic, because the FLRE split function works nearly exactly like ECMAScript/JavaScript's String.split().
And when you don't use capture groups or when you do use just non-capturing (?:) groups, then the FLRE split function act also similiar like PHP's preg_split or any another 08/15 split function in any other framework or language ecosystem.
splitting a#b-c#d- by regex #(\w*)- => ['a','b','c','d']
splitting a#b-c#d- by regex #(\w*)- => ['a','b','c','d', '']
Just read your favorite ECMAScript/JavaScript reference on the String.split() topic, because the FLRE split function works nearly exactly like ECMAScript/JavaScript's String.split().
But I need XQuery's tokenize
If you do a simple split with TFLRE.Create('#', []), both 'a' and 'a#' split to the same single element array ['a']. so you cannot join it back together to get the original input. I think the latter should give ['a', '']