Replacing and Splitting
Replace
The System.Text.RegularExpressions.Regex
Class provides several overloads of replace
. The same overloads are available in the VerbEx
class and as individually
named functions in the FsRegEx
module, including overloads and functions using RegexOptions
. Timeout
is not supported at this time.
simple replacement of all occurence
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: |
|
replace max time starting at
Replaces a specified maximum number of strings starting at location that match a regular expression pattern with a specified replacement string.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: |
|
replace with MatchEvaluator
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: |
|
Splitting
The System.Text.RegularExpressions.Regex
Class provides several overloads of split
to split strings into arrays. The same overloads are available in the VerbEx
class and as individually
named functions in the FsRegEx
module, including overloads and functions using RegexOptions
. Timeout
is not supported at this time.
split with Regex option
1: 2: 3: 4: 5: 6: 7: 8: 9: |
|
from FsVerbalExpressions
Full name: FsVerbalExpressions.FsRegEx.replace
Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
Full name: FsVerbalExpressions.FsRegEx.replaceMaxTimesStartAtOpt
| None = 0
| IgnoreCase = 1
| Multiline = 2
| ExplicitCapture = 4
| Compiled = 8
| Singleline = 16
| IgnorePatternWhitespace = 32
| RightToLeft = 64
| ECMAScript = 256
| CultureInvariant = 512
Full name: System.Text.RegularExpressions.RegexOptions
Full name: Replacesplit.capText
inherit Group
member Groups : GroupCollection
member NextMatch : unit -> Match
member Result : replacement:string -> string
static member Empty : Match
static member Synchronized : inner:Match -> Match
Full name: System.Text.RegularExpressions.Match
struct
member CompareTo : value:obj -> int + 1 overload
member Equals : obj:obj -> bool + 1 overload
member GetHashCode : unit -> int
member GetTypeCode : unit -> TypeCode
member ToString : unit -> string + 1 overload
static val MaxValue : char
static val MinValue : char
static member ConvertFromUtf32 : utf32:int -> string
static member ConvertToUtf32 : highSurrogate:char * lowSurrogate:char -> int + 1 overload
static member GetNumericValue : c:char -> float + 1 overload
...
end
Full name: System.Char
Char.IsLower(s: string, index: int) : bool
Char.ToUpper(c: char, culture: Globalization.CultureInfo) : char
String.Substring(startIndex: int, length: int) : string
Full name: FsVerbalExpressions.FsRegEx.replaceByMatch
delegate of Match -> string
Full name: System.Text.RegularExpressions.MatchEvaluator
Full name: FsVerbalExpressions.FsRegEx.splitOpt
member Clone : unit -> obj
member CopyTo : array:Array * index:int -> unit + 1 overload
member GetEnumerator : unit -> IEnumerator
member GetLength : dimension:int -> int
member GetLongLength : dimension:int -> int64
member GetLowerBound : dimension:int -> int
member GetUpperBound : dimension:int -> int
member GetValue : [<ParamArray>] indices:int[] -> obj + 7 overloads
member Initialize : unit -> unit
member IsFixedSize : bool
...
Full name: System.Array
Full name: Microsoft.FSharp.Collections.Array.iter