<FONT FACE=monospace>#!/usr/local/bin/perl<br>$string = 'stuff ¦ 12.34ns ¦ 34.56ns';<br><br># explain match - <font color=red>\d*</font> - matches zero or more digits<br># - <font color=red>\.{0,1}</font> - matches zero or one dot<br># - <font color=red>\d*</font> - matches zero or more digits<br># - <font color=red>ns</font> - obviously matches 'ns'<br># - the <font color=red>'g'</font> - match as many times as possible<br>while ($string =~ /\d*\.{0,1}\d*ns/g) <br> {<br> print "$&\n";<br> }<br># <font color=red> $& </font> catches matched patterns<br></font>