en:replacex [BASIC 256 - Language Documentation]

# BASIC 256 - Language Documentation

en:replacex

## Replacex (Function)

### Formato

replacex ( haystack_expr , regex_expr , string_expr )

returns string_value

### Description

Return a new string where all occurrences of substrings matching the regular expression regex_expr are replaced by string_expr in the string haystack_expr.

### Example

    a$ = "Ouvi bossa e saí da fossa"
    print Replacex(a$,"bossa","sopa")
    print Replacex(a$, "[bf]ossa", "sopa")

will display

    Ouvi sopa e saí da fossa
    Ouvi sopa e saí da sopa

### Notes

By default the nature of regular expressions is “greedy”. This behaviour can be changed using the RegexMinimal statement.

### See Also

Asc, Chr, Count, Countx, Explode, Explodex, Implode, Instr, Instrx, Left, Length, Lower, MD5, Mid, Midx, Replace, Replacex, Right, String, Upper

### History

0.9.6.56 | New to Version

en/replacex.txt · Last modified: 2014/08/06 20:18 by admin