fable-providers-regex

Regex Type Providers for Fable. At the moment there's a SafeRegex type which provides you a way to create regular expression and tell you immediately if the pattern is malformed.

Usage no npm install needed!

<script type="module">
  import fableProvidersRegex from 'https://cdn.skypack.dev/fable-providers-regex';
</script>

README

fable-providers-regex

Regex Type Providers for Fable. At the moment there's a SafeRegex type which provides you a way to create regular expression and tell you immediately if the pattern is malformed.

Please note that only compatible type providers like this one can be used with Fable. But don't worry, more providers are coming soon to Fable!

Installation

$ npm install --save-dev fable-providers-regex

You need fable-compiler@0.3.16 or higher to use the provider.

Usage

In a F# project (.fsproj)

  <ItemGroup>
    <Reference Include="node_modules/fable-providers-regex/Fable.Providers.Regex.dll" />
  </ItemGroup>

In a F# script (.fsx)

#r "node_modules/fable-providers-regex/Fable.Providers.Regex.dll"

open Fable.Providers.Regex

let reg = SafeRegex.Create<"my\s+regexP?", ignoreCase=true>()