Other monks have already pointed out the problems with the way you are reading from the OUT handle. For more info on regular expressions, you could try doing a search for "extracting". I found a number of nodes.
Extracting a substring?And there are many others
In reply to Re: extracting number from middle of string
by ehdonhon
in thread extracting number from middle of string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |