amitvalia has asked for the wisdom of the Perl Monks concerning the following question:
What I was expecting this to do is match fields likeif ($desc =~ /;FTP*:*/) { $txn_type = 4 ; print "Desc before changing: $desc \n"; .... }
;FTP : Foreign Tax Withheld
;FTP : File Transfer to server etc.
But it's picking up desc that is ;FTR :Foreign Tax Reclaim
Here's the output of the print statement in my code above
Desc before changing: ;FTR :Foreign Tax Reclaim (BASFY)
Desc before changing: ;FTR :Foreign Tax Reclaim (SIEGY)
Desc before changing: ;FTR :Foreign Tax Reclaim (SIEGY)
Desc before changing: ;FTR :Foreign Tax Reclaim (DDAIY)
How is /;FTP*:*/ matching the lines above? What am I doing wrong here?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: string matching
by Paladin (Vicar) on Jan 26, 2017 at 22:18 UTC | |
|
Re: string matching
by hippo (Archbishop) on Jan 26, 2017 at 23:31 UTC | |
|
Re: string matching
by stevieb (Canon) on Jan 26, 2017 at 22:49 UTC | |
|
Re: string matching
by Laurent_R (Canon) on Jan 27, 2017 at 07:14 UTC | |
|
Re: string matching
by amitvalia (Novice) on Jan 27, 2017 at 21:11 UTC |