in reply to how to find particular string and store in to variable
What have you tried? Are all of your lines going to be exactly the same with an integer at the end of the line?
#!/usr/bin/perl use warnings; use strict; my $str = "http://172.20.37.115:8080/se/1.0/provision/subscribers/1989 +68"; $str =~ /.*\/(\d+)$/; my $var = $1 || ''; print "$var\n";
-stevieb
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to find particular string and store in to variable
by 1nickt (Canon) on Jun 25, 2015 at 13:40 UTC | |
by AnomalousMonk (Archbishop) on Jun 25, 2015 at 13:58 UTC | |
by 1nickt (Canon) on Jun 25, 2015 at 14:16 UTC | |
by AnomalousMonk (Archbishop) on Jun 25, 2015 at 14:39 UTC | |
by 1nickt (Canon) on Jun 25, 2015 at 16:08 UTC | |
by 1nickt (Canon) on Jun 25, 2015 at 14:13 UTC | |
by AnomalousMonk (Archbishop) on Jun 25, 2015 at 14:23 UTC | |
|
Re^2: how to find particular string and store in to variable
by AnomalousMonk (Archbishop) on Jun 25, 2015 at 13:38 UTC |