in reply to Re^2: Extracting money from a double quoted string
in thread Extracting money from a double quoted string
The code you posted already works for me, with the simple change of double to single quotes:
#!/usr/local/bin/perl $string='Price is $9.99 on our website'; ($money) = $string =~ m/is\s\$([0-9]{1,2}\.[0-9]{2})\son/g; print $money; __END__ 9.99
You can help us help you better by posting a short, self-contained program that we can use to reproduce your problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Extracting money from a double quoted string
by sherab (Scribe) on Dec 06, 2014 at 18:59 UTC | |
by Corion (Patriarch) on Dec 06, 2014 at 19:02 UTC |