Skip to content

Instantly share code, notes, and snippets.

open System
let inline (^) f x = f x
type Phase = {
Text: string
DateTimes: DateTime list
}
type ResultPhase =
open System.Text.RegularExpressions
let dateTimeRx = @"(?<dateTime>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3} \+\d{2}:\d{2})" // lang=regex
let guidRx = @"(?<guid>[0-9A-f]{8}\b-[0-9A-f]{4}\b-[0-9A-f]{4}\b-[0-9A-f]{4}\b-[0-9A-f]{12})" // lang=regex
let commonSmErrorRx = Regex(
$@"%s{dateTimeRx} (?<error>\[Error\] HandleData\. Error getting recognition RESULT for %s{guidRx})",
RegexOptions.Compiled)
let test = """
2024-04-04 15:31:06.123 +00:00 [Error] HandleData. Error getting recognition RESULT for 12345678-abcd-1234-abcd-123456789abc
@brud
brud / CmdCall.fsx
Created July 18, 2023 11:08
Cmd caller with error
open System
open System.Diagnostics
open System.Threading.Tasks
type CommandResult = {
ExitCode: int;
StandardOutput: string;
StandardError: string
}