can any one explain me what the following code do. ($whole,$deci) = /(?:(\d*)\.?(\d+))|(?:(\d+)\.?(\d*))/;
Yes. The pattern matches either (\d*)\.?(\d+) or (\d+)\.?(\d*). The variable $whole is assigned the contents of the first set of capturing parentheses ((\d*) or (\d+)) and the variable $deci is assigned the contents of the second set of capturing parentheses ((\d+) or (\d*)).
Update: Thanks ikegami. It looks like I couldn't get anything right yesterday. :-(
In reply to Re: meaning for the code
by jwkrahn
in thread meaning for the code
by sanku
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |