perlmad has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks
I have a doubt on regular expression below is my code
my $string="{'totalResultsCount':71-24,'securityList':[{'cusip':'91%27 +9-6.H:Y8','issueDate':'2016-06-02T00:00:00','securityType':'Bill'}"; $string =~ /'cusip':'(\w+\-\$\.\%)'/; print " first is : $1 \n\n";
output is
Use of uninitialized value in concatenation (.) or string at sample.pl + line 7. first is :
Because the "\w+" on supports alphanumeric values but my question is how to include alphanumeric and special character with in the parenthesis , I have tried the above code but i could not get an exact answer , Is there need any changes in Regular expression ???
Expected output
first is :912796HY8
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regular Expression on special character and alphanumeric values
by Eily (Monsignor) on May 30, 2016 at 17:01 UTC | |
|
Re: Regular Expression on special character and alphanumeric values
by Corion (Patriarch) on May 30, 2016 at 16:46 UTC | |
|
Re: Regular Expression on special character and alphanumeric values
by johngg (Canon) on May 30, 2016 at 17:52 UTC | |
|
Re: Regular Expression on special character and alphanumeric values
by Marshall (Canon) on May 31, 2016 at 06:38 UTC | |
|
Re: Regular Expression on special character and alphanumeric values
by $h4X4_|=73}{ (Monk) on May 30, 2016 at 17:59 UTC | |
|
Re: Regular Expression on special character and alphanumeric values
by james28909 (Deacon) on May 30, 2016 at 19:15 UTC | |
by perlmad (Sexton) on May 31, 2016 at 04:26 UTC |