I
Ikke
Hi everybody,
First of all, if this is not the right group to ask, I apologize. I could
not find a specific regex group, so I decided to turn to those who know
Perl.
I am trying to build a regex, which needs to capture data from a .csv
file in a very specific format.
The first part should be a filename - either enclosed in quotes, or not.
This is the part that is giving me problems.
I've created something like: ((filename)|quote(filename)quote) which
matches the text as I would like, but it doesn't capture the text as
expected.
If there are no quotes, the text is returned as group 1. If there are
quotes, group 2 returns the filename with the quotes. I'd like the quotes
to be removed from this group. I assumed that, if the first part of the
expression matches, the double braces would indicate that group 2 would
return the name as well, but this is not the case. Apparently ((regex))
equals (regex).
Does anybody know a solution for this problem?
Thank you very much,
Ikke
First of all, if this is not the right group to ask, I apologize. I could
not find a specific regex group, so I decided to turn to those who know
Perl.
I am trying to build a regex, which needs to capture data from a .csv
file in a very specific format.
The first part should be a filename - either enclosed in quotes, or not.
This is the part that is giving me problems.
I've created something like: ((filename)|quote(filename)quote) which
matches the text as I would like, but it doesn't capture the text as
expected.
If there are no quotes, the text is returned as group 1. If there are
quotes, group 2 returns the filename with the quotes. I'd like the quotes
to be removed from this group. I assumed that, if the first part of the
expression matches, the double braces would indicate that group 2 would
return the name as well, but this is not the case. Apparently ((regex))
equals (regex).
Does anybody know a solution for this problem?
Thank you very much,
Ikke