This shows you the differences between two versions of the page.
en:explodex [2016/08/12 21:16] admin |
en:explodex [2020/02/28 10:46] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Explodex (Function) ===== | ||
- | ==== Format ==== | ||
- | variable = **explodex** ( [[stringexpressions|string_expression]] , [[regularexpressions|regular_expression]] ) | ||
- | |||
- | returns a [[lists|list]] of strings that must be assigned to a // | ||
- | |||
- | ==== Description ==== | ||
- | Splits up [[stringexpressions|string_expression]] into substrings wherever the regular expression [[regularexpressions|regular_expression]] occurs. | ||
- | |||
- | If the regular expression includes capturing groups, using parenthesis, | ||
- | ==== Example ==== | ||
- | < | ||
- | # explode on regex //[,]* // | ||
- | a$ = "We all live in a yellow submarine, yellow submarine, yellow, submarine." | ||
- | w$ = explodex(a$," | ||
- | for t = 0 to w$[?]-1 | ||
- | print " | ||
- | next t | ||
- | |||
- | # explode on regex // | ||
- | a$="1 and 2 AND 3 and 5 aND 99 AND 8.88 aNd 6.45" | ||
- | n = explodex(a$," | ||
- | for t = 0 to n[?]-1 | ||
- | print " | ||
- | next t | ||
- | </ | ||
- | will display | ||
- | < | ||
- | We all live in a yellow submarine. | ||
- | w$[0]=We | ||
- | w$[1]=all | ||
- | w$[2]=live | ||
- | w$[3]=in | ||
- | w$[4]=a | ||
- | w$[5]=yellow | ||
- | w$[6]=submarine | ||
- | w$[7]=yellow | ||
- | w$[8]=submarine | ||
- | w$[9]=yellow | ||
- | w$[10]=submarine. | ||
- | n[0]=1 | ||
- | n[1]=2 | ||
- | n[2]=3 | ||
- | n[3]=5 | ||
- | n[4]=99 | ||
- | n[5]=8.88 | ||
- | n[6]=6.45 | ||
- | </ | ||
- | |||
- | ==== Notes ==== | ||
- | By default the nature of regular expressions is " | ||
- | |||
- | ==== See Also ==== | ||
- | {{page> | ||
- | |||
- | ==== History ==== | ||
- | |0.9.6.56|New to Version| | ||
- | |1.99.99.9|Added Regex Capturing| | ||
- | |1.99.99.55|now allow explode to be used anywhere a list may be used| |