[Lazarus] use of function ExtractWord
mailinglists at geldenhuys.co.uk
Tue Sep 15 16:15:23 CEST 2015
On 2015-09-15 14:46, John Landmesser wrote:
> If i want to extract '(813 KB/s)', i have to extract the SECOND word!!
Michael already explained it.
I would rather opt to use regex to extract the exact piece of text you
are interested in. FPC includes a capable regex implementation.
regex string: ⸢\((\d+\w.*/s)\)⸥
and you should be able to reference the value between '(' and ')' with
the first matching group... normally referenced as ⸢\1⸥
The text between ⸢ and ⸥ are the regex syntax.
- Graeme -
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
More information about the Lazarus