Project

General

Profile

Actions

$hregex » History » Revision 2

« Previous | Revision 2/3 (diff) | Next »
Per Amundsen, 01/16/2019 10:05 PM


Added in 3.3

$hregex(name|N,text,[N])

Searches table for the Nth item name which matches text using a regular expression and returns the item name.

See also /hsave, /hload, /hmake, /hfree, /hdel, $hget.

See also $hfind, $hmatch.

Parameters

name|N - Name of the hash table or the Nth hash table.
text - Text to search for.
[N] - If N = 0, number of matches, otherwise the Nth match. (optional)

Properties

.data - Search for a matching data value instead of item name.

Example

; Searches the hash table 'Example' and prints the number of matches.
//echo -ag result: $hregex(Example, /.*/, 0)

; Searches the hash table 'Example' and prints the first matched item.
//echo -ag result: $hregex(Example, /.*/, 1)

; Searches the hash table 'Example' and prints the first matched data.
//echo -ag result: $hregex(Example, /.*/, 1).data

Updated by Per Amundsen about 5 years ago · 2 revisions

Also available in: PDF HTML TXT