diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2015-07-30 17:26:16 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2015-07-30 17:26:16 -0400 |
commit | 655f2bc59e11ccd16229f2e7474b013e585192fb (patch) | |
tree | 266f59b5894d7aee96441f5f9da8e1e474fbcb03 /src/regex.urs | |
parent | 285053f45f39752e46899a9e99f1cfe1ca76165c (diff) |
Implement regex substitution
Diffstat (limited to 'src/regex.urs')
-rw-r--r-- | src/regex.urs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/regex.urs b/src/regex.urs index c3d2c7f..9d2ad25 100644 --- a/src/regex.urs +++ b/src/regex.urs @@ -24,3 +24,10 @@ strs', where 'strs' is a list of subexpression matches, if a match succeeds, and val match : string (* needle *) -> string (* haystack *) -> option (list string) + +(* Replaces all substrings in 'haystack' that match 'needle' with the string +'replacement.' *) +val replace : string (* needle *) + -> string (* haystack *) + -> string (* replacement *) + -> string |