Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <img src='blah' alt='foo' />
- // extracting content of 'src' from one html image element
- string '<img' not string '/>' string 'src=' extract quoted '\'','"' '\\' not string '<img' string '/>'
- - string '<img' - string to look for
- - not string '/>' - discard if this string was found before...
- - string 'src=' - string to look for
- - extract - add to output array
- - quoted '\'','"' '\\' - match a quote (arg1 - quoting strings, arg2 - escaping string)
- - not string 'img' - discard if this string was found before...
- - string '/>' - string to look for
- grammar
- string-literal-list: <string-literal> [ ',' <string-literal> ] x 0+
- string-check: 'string' <string-literal> // get position of string, fail if not found
- not-check: 'not' <function> <function> // get position of both functions, fail if 1 before 2
- quoted-check: 'quoted' <string-literal-list> <string-literal-list> // get position of quoted string, fail if not found
- extract-op: 'extract' <function> // mark range for extraction
- match: <string-check> | <not-check> | <quoted-check> | <extract-op>
- match-list <match> [ <match> ] x 0+
- program: <match-list>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement