====== RegExReplace(text, replace_text, regex_text) ======
Category:  Text function

\\ 
=====Description=====
This function replaces the first substring within //text// that matches the regular expression pattern (//regex_text//) with the given replacement string, //replace_text//.

\\ 
=====Use cases=====
//RegExMatch// is useful for fuzzy-matching and replacing substrings of text using a specific pattern of characters.


\\ 
=====Arguments=====
^Argument^Type^Description^
|text|Text|The text value to test for the //regex_text// RegEx pattern.|
|replace_text|Text|The text value to replace any text found that matches the //regex_text// RegEx pattern.|
|regex_text|Text (RegEx pattern)|The string pattern to search for within //text//.  The first instance of any text matching this pattern\\ is replaced with //replace_text//.|

**Return value type:** Text

\\ 

=====Remarks=====

EasyMorph uses the [[https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference|.NET regex language]].

\\
=====Examples=====
  
  regexreplace('12345678', 'ABCD', '^\d{4}') //Returns 'ABCD5678'

  regexreplace('MaryAnne', 'Jo', '[a-zA-Z]{4}') //Returns 'JoAnne'


\\ 
===== See also =====
  * [[syntax:functions:isregexmatch|IsRegExMatch(text, regex_text)]]
  * [[syntax:functions:regexmatch|RegexMatch(text, regex_text)]]
  * [[syntax:functions:replace|Replace(text, string_old, string_new)]]
  * [[syntax:functions:replacebetween|ReplaceBetween(text, string1, contents, string2 [,N])]]
  * [[syntax:functions:replacebetweenmany|ReplaceBetweenMany(text, string1, contents, string2 [,N])]]
