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.
Parameters
Object of type FILE.file that identifies the file that will be accessed. Note that this is not a string holding the filename.
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);Additional Examples
v/dv_examp/file_ucd.v
v/dv_examp/file_unif.vFile
See also related modules