Created
June 6, 2011 10:09
-
-
Save nagat01/1010030 to your computer and use it in GitHub Desktop.
C#たん講座 第1.5回の5 F#版
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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