regexAll

regexAll ( string regex , string _subject , int _numberOfMask ) : string[]

Return the mask of a regex for all corresponding instances.

Example


allDivs=regexAll(/(?si)<div>(.+)<\/div>/)




See also

regex
cleanRegex
cleanRegexAll

Parameters

regex

The regular expression to apply on _code. See regex for the pattern. It is important to remember to put a mask (...) to capture a substring, because it is not the expression of the regex that will be returned but the sub-mask of number _numberOfMask. If you want the whole thing, make a mask around the whole expression.

_subject (optional)

The string in which regex will be searched. It doesn't have to be HTML code, you can put any kind of text in it. If null it is the page code in a FORPAGE script.

_numberOfMask (optional)

Default:1. Place of the mask in the regex. Masks are defined by brackets. You can create many masks in regular expressions. To find out the mask number, count the number of opening parentheses from the left.
If numberOfMask = -1 -> it return the Matcher object (use find and group method on)