Hi All,
I'm trying to match a particular pattern in a multi-line string. The string
might look like:
string
Some text.
Some more text.
[[ft1: An example of the search string [[fn2
[[ft2: Another example of a search string]]
Extra text
/string
In this case, I'm trying to perform a preg_match using the following
expression:
preg_match(/^\[\[ft.$fn[1].:(.*)\]\]$/m,$content,$ft);
In the above example, the preg_match would be applied twice, once with a
$fn[1] value of 1, the second time with a $fn[1] value of 2. The $content
variable contains the string above.
I'm attempting to accommodate a situation where the target string might
contain ]] before I want the capture to finish, as in the first example
above. I'm hoping to return both the whole value matched by the preg_match,
as well as the content of the matched string after the : character up to
the final closing ]] for the line.
In essence, the closing ]] for the match should always be at the end of
the line.
My attempt to build a pattern, as above, isn't working. I'm wondering if
anyone can give me some advice on how to fix it?
Many thanks in advance and much warmth,
Murray
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php