regex - Find text between string -


how extract text using perl string this:


get text 1 ... --------------------------------------------------------------------------------------------- text 2 ... --------------------------------------------------------------------------------------------- text 3 --------------------------------------------------------------------------------------------- 

the result should this:

%texts =  ( 'text1' => 'get text 1 ...', 'text2' => 'get text 2 ...', 'text3' => 'get text 3 ...' ) 

something php preg_match_all.

many thanks

if preg_macth_all looks preg_match_all('/(foo)/', $text, $matches), perl equivalent @matches = $text=~/(foo)/g.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -