I need to extract two groups from a text like this:
Beginning | (Lorem Ipsum)
NextLine: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem
The "Lorem Ipsum" (inside paranthesis) and the long text "Lorem Ipsum is simply dummy text...". This is the regex wich works fine on https://regex101.com/ :
((?<=\|\s\().*(?=\))).*\n.*((?<=NextLine:\s).*$)
But this regex doesn't work in perl (executed in CLI) returns nothing.
This is the perl command is getting executed in CLI (with gm
options):
cat File | perl -ne '/((?<=\|\s\().*(?=\))).*\n.*((?<=NextLine:\s).*$)/gm' && print $1 . ", " . $2'