---
title: "Regex"
type: "forum-thread"
url: "https://www.webforum.nu/amne/dotnet/112722-regex"
topic: ".NET"
topic_url: "https://www.webforum.nu/amne/dotnet"
author: "DavidB"
published: "2004-10-02T10:13:43.000Z"
updated: "2004-10-02T11:53:39.000Z"
replies: 1
views: 183
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/dotnet/112722-regex"
---

# Regex

## #1 — DavidB, 2004-10-02T10:13Z

Tjena

Jag har ett mönster som ser ut såhär:

```
<nobr>[a-z0-9]{0,9}</nobr>
```

Hur gör jag nu för att få ut det värde som ligger mellan \<nobr\>
och \</nobr\> till en egen string?

Permalänk: https://www.webforum.nu/p/112722

## #2 — Dino, 2004-10-02T11:53Z

```
string html = @"<body><h1>Lalala</h1><br/><nobr>Ohh yeah</nobr>
sadf adsf hsdaofh nsadf ösadofj öä<nobr>Hmm</nobr> <hr/><nobr>
Wow wow wow
</nobr>

87667 c 65 5696
&gtr <span>...</span>
   <nobr>  0123234234 </nobr>
</body>";

string reg = "<nobr>(.*?)</nobr>";
MatchCollection mc = Regex.Matches(html, reg, RegexOptions.Singleline);

foreach(Match m in mc)
   Response.Write(m.Groups[0].Value + "<br/>");
```

Permalänk: https://www.webforum.nu/p/1450768

---

Tråden på webben: https://www.webforum.nu/amne/dotnet/112722-regex
