I am trying to parse a text file contaning customer information of the following format:
AB1\tA{Daniel Wright}\sA{Jack Smith}\sB{Jane Goodwin} QW1\tA{Samantha Patton}\sC{Timothy Eeckles} AR2\tA{Jane Goodwin}
Each line may contain different number of customers and this has made it difficult for me to write a regex to capture all customers<\p>
I would like to put all the names into an array and then print them out along with the number of times a customer's name is mentioned in the file:
Jane Goodwin 2 Daniel Wright 1 Jack Smith 1 Samantha Patton 1 Timothy Eeckles 1
I used the following regex to extrac the names and put them into an array but it captures only the first customer on every line.
if ($line =~ m/{(.*?)}/g) { $customer_name = $1; push (@Customer_List, $customer_name);
How can I modify this regex to match more than one instance, i.e, multiple customer names?
Thank you
In reply to Matching multiple {hits} by sophix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |