在正则表达式中两个事物之间存在时跳过开始

hello this is my string

line('hello this is my \'first\' line')
line('hello this is my \'second\' line')
line('hello this is my \'third\' line')
line('hello this is my last line')

i want to use regex and get something like this

hello this is my \'first\' line
hello this is my \'second\' line
hello this is my \'third\' line
hello this is my last line

i am using this regex

line[(][']([^']*)['][)]

this regex just can get the last line because in each other lines ' ' exists. what should i do on this regex to get all line like result that i want?

Just please edit ([^']*) i just want to use this. (using start)

Try this:

preg_match("/line\('(.*)'\)/", $string, $output_array);

http://www.phpliveregex.com/p/fmb

Edit.... preg_match_all("/line('([^']*)')/", $input_lines, $output_array);

http://www.phpliveregex.com/p/fmj

Use this regular expression:

 ^line[\(][\'](.*)[\'][\)]$