## GOSearchReplace

GOSearchReplace

## Functions

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

## Properties

gboolean | ignore-case | Read / Write
gboolean | is-regexp | Read / Write
gboolean | match-words | Read / Write
gboolean | preserve-case | Read / Write
gchar * | replace-text | Read / Write
gchar * | search-text | Read / Write

## 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. |

## Property Details

### The `“ignore-case”` property

      “ignore-case”              gboolean

Ignore the case of letters.

Owner: GOSearchReplace

Flags: Read / Write

Default value: FALSE

### The `“is-regexp”` property

      “is-regexp”                gboolean

Is the search text a regular expression.

Owner: GOSearchReplace

Flags: Read / Write

Default value: FALSE

### The `“match-words”` property

      “match-words”              gboolean

Match whole words only.

Owner: GOSearchReplace

Flags: Read / Write

Default value: FALSE

### The `“preserve-case”` property

      “preserve-case”            gboolean

Preserve the case of letters.

Owner: GOSearchReplace

Flags: Read / Write

Default value: FALSE

### The `“replace-text”` property

      “replace-text”             gchar *

The text to replace with.

Owner: GOSearchReplace

Flags: Read / Write

Default value: NULL

### The `“search-text”` property

      “search-text”              gchar *

The text to search for.

Owner: GOSearchReplace

Flags: Read / Write

Default value: NULL