Hi,
I am trying to pull only the 1st comment from a field that can have 1 or many comments enclosed within {} curly brackets. So the field can look like this:
$field={10-20-2007 My comment1}{My comment2}{comment3}
or
$field={10-20-2007 My comment1}
and I always only want to grab the 1st contents of the 1st set of {} curly brackets.
I tried variations of this without success:
$field = $1 if ($field =~ /^(\{.+\}).+$/);
it just grabs the entire $field. I need some Regex expertise. Thanks so much.
ljs
I am trying to pull only the 1st comment from a field that can have 1 or many comments enclosed within {} curly brackets. So the field can look like this:
$field={10-20-2007 My comment1}{My comment2}{comment3}
or
$field={10-20-2007 My comment1}
and I always only want to grab the 1st contents of the 1st set of {} curly brackets.
I tried variations of this without success:
$field = $1 if ($field =~ /^(\{.+\}).+$/);
it just grabs the entire $field. I need some Regex expertise. Thanks so much.
ljs