I have a line like this
[test: test1: http://localhost?test=[1,2]]
[test: test2: http://localhost?test=[2,3]]
and I want to extract the text from it below
$1 = "test1"
$2 = "http://localhost?test=[1,2]"
$1 = "test2"
$2 = "http://localhost?test=[2,3]"
I'm trying to
/\[test:(.*?):(.*?)\]/
but he comes back like that. without "]"
$2 = "http://localhost?test=[2,3"
How can I change my regular expression to get what I intend? thank.
source
share