file_find_expr


Synopsis


file_find_expr(file, offset, regular_expression)

Description

The file_find_expr object searches for a pattern that matches a user-specified UNIX regular expression string. This capability only works on UNIX systems. It returns the offset in bytes of the next byte after the expression.

Example

In the ASCII file, data , find the integer "ndim" that follows an expression:

ndim <any number of spaces> = <any number of spaces>




file data_file {
name = "data";
};


int offset => file_find_expr(data_file, 0, "ndim[ ]*=[ ]*");
int ndim => file_scalar_ascii(data_file, offset, 3);