Regular expressions



next up previous contents index
Next: Mark Up: Functions Previous: Search and substitution

Regular expressions

 

re_forward_search

  int re_forward_search(char * regexp)

Returns the position of the next regular expression regexp or -1 if regexp has not been found or -2 if regexp is not valid.

re_backward_search

  int re_backward_search(char * regexp)

Returns the position of the previous regular expression regexp or -1 if regexp has not been found or -2 if regexp is not valid.

re_match_beginning

  int re_match_beginning(int n)

Returns the beginning position of the substring n of the regexp found by the previous search call to a regexp else -1 if regexp is not valid. The first substring of a regexp is numbered 0. (see GNU regexp manual).

re_match_end

  int re_match_end(int n)

Returns the end position of the substring n of the regexp found by the previous search call to a regexp, else -1 if regexp is not valid (see GNU regexp manual).

re_replace

    int re_replace(char *newstring)
int re_replace(char *newstring, char * regexp)

Replaces the regular expression regexp with the string newstring. If the argument regexp is ommited, the previous search call to a regexp is used. It returns 1 on success, else 0 (see GNU regexp manual).



Lionel Fournigault
Mon Mar 6 13:33:34 MET 1995