Skip to content

Instantly share code, notes, and snippets.

@nagat01
Created June 6, 2011 10:09
Show Gist options
  • Save nagat01/1010030 to your computer and use it in GitHub Desktop.
Save nagat01/1010030 to your computer and use it in GitHub Desktop.
C#たん講座 第1.5回の5 F#版
// http://codezine.jp/article/detail/5696?p=5
// I don't own any right for this program.
// Read above url for read original program.
// You can escape double quote by writing it
// twice in verbatim string literal.
// [^""]* : match to double quote any times
// \> : unknown
// \< :
// (?<title>.*) : match to any character any times
// and this group is named as "title"
// namespaces can't directory contain functions and variables
// namespaces can only contain modules and types
namespace XBox
module XBox =
open System
open System.Net
open System.Text
open System.Text.RegularExpressions
let main =
let client = new WebClient(Encoding=Encoding.UTF8)
let html = client.DownloadString "http://marketplace.xbox.com/ja-JP/Games/All?xr=shellnav"
let matches = Regex.Matches(html, @"/ja-JP/Pro[^""]*""\>(?<title>.*)\</a")
for m in matches do
printfn "%A" <| m.Groups.["title"].Value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment