llFindNotecardTextSync
list llFindNotecardTextSync(string name,// Name of a notecard in the prim's inventory, or a UUID.string pattern,// Regular expression pattern to search for.integer start,// Number of match results to skip before returning (0 to start at the first match).integer count,// Maximum number of matches to return (if 0, returns the first 64 matches).list options// A list of options for future expansion (unused, should be []).
);- Returns
list- Energy
- 10
Synchronously searches a cached notecard name for lines containing pattern, returning a list of line and column numbers. Returns a list containing 'NAK' if the notecard is not cached, or an empty list if no matches are found.
Returns a list of lines and columns where the search pattern is found in the notecard.
Returns a list containing only NAK if the notecard is not cached.
list result = llFindNotecardTextSync("", "", 0, 0, []);Specification
Section titled “Specification”Searches the text of a cached notecard for lines containing the given pattern. If the notecard is not in the cache, returns a list containing a single NAK, otherwise a list of matches of the pattern in the notecard. If no matches are found, or the notecard contains embedded items, an empty list is returned.
Every match in the notecard is represented as a sequence of three integers:
[integer row, integer column, integer length]In other words the returned list has a stride of 3. A maximum of 64 matches are returned, resulting in a maximum list length of 192.
If the notecard does not exist, returns a list containing a single NAK and the script will shout an error on DEBUG_CHANNEL (but the script continues to run).
If there is an error in the regular expression, returns an empty list and the script will shout an error on DEBUG_CHANNEL (but the script continues to run).
Notecards are cached into a fixed-size buffer, with the oldest (least-recently read) notecard getting removed first. It is not safe to assume a notecard has been previously cached. Data for a previously cached notecard may be dropped from the cache at any time, especially on a busy server.
Caveats
Section titled “Caveats”- If notecard contains embedded inventory items (such as textures and landmarks), an empty list will be returned, regardless of the search string.
- No more than 64 matches are returned.
Regular Expression Cheat Sheet
Section titled “Regular Expression Cheat Sheet”See also
Section titled “See also”Functions
Section titled “Functions”Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.