Search and substitution



next up previous contents index
Next: Regular expressions Up: Functions Previous: Change buffer contents

Search and substitution

forward_search

     int forward_search(char * str);

Searches for str through the next characters, returns 1 and goes to the beginning of the string on success, else returns 0.

backward_search

   int backward_search(char * str);

Searches for str through the previous characters, returns 1 and goes to the beginning of the string on success, else returns 0.

msearch

   int msearch(char * string, int end, int direction);

Searches for a character among str (except the last 0) in the current buffer, forward if direction is positive or null and backward if direction is negative. Search stops at the end position. Returns 1 and goes to the corresponding position on success, otherwise returns 0 and goes to end position. Here is its definition:

global_replace

   int global_replace(char * str1, char * str2)

Searches for and replaces str1 by str2 in the next characters and returns the number of substitutions . The current position is not modified.



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