FUNCTION STRALLPOS, string, search ;+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; STRALLPOS v. 2.0, 6 February 2004. ; ; Jesús Maíz-Apellániz, STScI ; ; ; ; This procedure finds all the instances of search in string. ; ; ; ; Positional parameters: ; ; string: Input string. ; ; search: Expression to search. ; ; ; ; Version history: ; ; v1.0: General clean up. ; ; v2.0: English version. ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;- pos0 = STRPOS(string, search) IF pos0 EQ -1 THEN RETURN, [-1] aux = 'kk' WHILE pos0 NE -1 DO BEGIN IF aux EQ 'kk' THEN pos = [pos0] ELSE pos = [pos,pos0] aux = '' pos0 = STRPOS(string,search,pos[N_ELEMENTS(pos)-1]+1) ENDWHILE RETURN, pos END