regex - Replacing the contents of a list of items using regular expressions -
given following string: lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla rhoncus ipsum eros tincidunt ultricies... [menu] item 1|http://stackoverflow.com/1 item 2|http://stackoverflow.com/2 item 3|http://stackoverflow.com/3 [/menu] lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla rhoncus ipsum eros tincidunt ultricies... i'm trying generate regular expression returns: lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla rhoncus ipsum eros tincidunt ultricies... <ul> <a href="http://stackoverflow.com/1">item 1</a> <a href="http://stackoverflow.com/2">item 2</a> <a href="http://stackoverflow.com/3">item 3</a> </ul> lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla rhoncus ipsum eros tincidunt ultricies... there 1 or more menu blocks in each string , unknown number of links within each block. i'm able swap whole block, falling on over rep...