With classic pattern matching, you can't. I suggest you to use .NET Regexp library and active patterns. You should read this paper about active patterns: [link:blogs.msdn.com]

One solution is:

1
2
3
4
5
6
7
8
9
10
11
12
open System.Text.RegularExpressions

let (|ParseRegex|_|) re s =
  if Regex(re).Match(s).Success then Some()
  else None

let urlFilter2 url agent =


  match url,agent with
   | ParseRegex "http://" (), _ -> true
   | _ -> false

- Laurent LB

By on 6/22/2007 6:16 PM ()

Thank you for the reply :) Very interesting article.

By on 6/27/2007 8:25 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper