On 29 Dec 2009, at 12:36, Karsten Düsterloh wrote:

> Let d be a set of delimiters and s be a long string including several of
> these delimiters in arbitrary order and count. Now try to process each
> block of text between two such delimiters in dependance upon the
> surrounding delimiters:
> [snip]
> - s.search(/[delimiters]/) is useless, because it always starts
> searching at index 0 - you would have to cut/change s after each find

s.search might be useless, but

re = /[delimiters]/g;
while ( ( m = re(s) ) != null ) {
}

works. and the fromIndex can be controlled by adjusting re.lastIndex (which is 
a badly named parameter - its behaviour is to control where the next match 
should start -- I think) This is to say nothing about the usefulness of toIndex 
arguments.

-ash

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to