Link to home
Start Free TrialLog in
Avatar of weversbv
weversbv

asked on

Splitting number

Have the following line:

$line = "Worldpay (12676141)";

This is what I need:
$test="12676141";

and $line has be change to:
$line = "Worldpay (<a href=\"http://www.test.com/test.cgi?test=1&we=2\">12676141</a>)";

How to do that!
Avatar of bigbed
bigbed
Flag of United Kingdom of Great Britain and Northern Ireland image

$line =~ s{^(.*?)\((.*?)\)$}{$1 (<a href=\"....\">$2</a>)};
$test = $2;
ASKER CERTIFIED SOLUTION
Avatar of webmaster_prodex
webmaster_prodex

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial