On Wed, 09 Jan 2008 12:06:35 -0800,
wrote:
> On Jan 9, 2:39 pm, Martijn Lievaart <m...@rtij.nl.invlalid> wrote:
>> On Wed, 09 Jan 2008 11:00:18 -0800, ame...@iwc.net wrote:
>> > I have the following expression in my Perl script:
>>
>> > if (/^"([^\,].+)"\,"$/)
(snip)
> I might add, the input file looks like this:
>
> "#ABC","
> [
> ","ABC Dispensing designs, manufactures and services dispensing systems
(snip)
Yes, that regex will match the first line.
$ perl -e 'print "yes\n" if "\"#ABC\",\"" =~ /^"([^\,].+)"\,"$/'
yes
(Note extra backslashes in the input line because this is executed from
the commandline)
BTW, the backslashes before the commas are completely unneeded.
$ perl -e 'print "yes\n" if "\"#ABC\",\"" =~ /^"([^,].+)","$/'
yes
HTH,
M4