I have a regular expression pattern that works for PCRE(PHP) that I would like to use in a lua file.
My objective is to inspect a value (string) to see if it contains a key identifier then to grab the value.
The test string may contain various characters including alphanumeric and special characters. Inside the string is a key followed by a value:
str = 'sample12_3 Word [link:a12]'
The key phrase to find is "[link:]" and the value it must return is whatever is following the ':' semicolon and before the closing square ']' bracket
[link:$value]
The PCRE(PHP) expression is:
\[(link):(.+):?[^\[\]]*\]
Group 1: 'link' Group 2: 'a12'
Can anyone help me with the correct lua iteration for this expression?