GOSearchReplace: GOffice Reference Manual

## GOSearchReplace GOSearchReplace |

## Functions

gboolean | go_search_match_string ()
GQuark | go_search_replace_error_quark ()
char * | go_search_replace_string ()
gboolean | go_search_replace_verify ()

## Types and Values

| GOSearchReplace

## Object Hierarchy

        GObject
        ╰── GOSearchReplace

## Description

## Functions

### go_search_match_string ()

    gboolean
    go_search_match_string (GOSearchReplace *sr,
                            const char *src);

### go_search_replace_error_quark ()

    GQuark
    go_search_replace_error_quark (void);

### go_search_replace_string ()

    char *
    go_search_replace_string (GOSearchReplace *sr,
                              const char *src);

#### Parameters

sr | A GOSearchReplace search-and-replace specification |
src | the source string |

#### Returns

the string after search-and-replace. However, if nothing changed, `NULL` is returned.

[transfer full][nullable]

### go_search_replace_verify ()

    gboolean
    go_search_replace_verify (GOSearchReplace *sr,
                              gboolean repl,
                              GError **err);

#### Parameters

sr | Search-and-Replace info to be checked |
repl | Check replacement part too. |
err | Location to store error message. |

#### Returns

`TRUE` if search-and-replace data is valid.

## Types and Values

### GOSearchReplace

    typedef struct {
    	char *search_text;
    	char *replace_text;

    	GORegexp *comp_search;
    	gboolean is_regexp; /* Search text is a regular expression.  */
    	gboolean ignore_case; /* Consider "a" and "A" the same.  */
    	gboolean preserve_case; /* Like Emacs' case-replace.  */
    	gboolean match_words; /* Like grep -w.  */
    } GOSearchReplace;

#### Members

char *`search_text`; | string to replace. |
char *`replace_text`; | string to use as replacement/ |
GORegexp *`comp_search`; | GORegexp |
gboolean `is_regexp`; | search text is a regular expression. |
gboolean `ignore_case`; | consider "a" and "A" the same. |
gboolean `preserve_case`; | like Emacs' case-replace. |
gboolean `match_words`; | like grep -w. |