---
title: "Regular expressions"
type: "forum-thread"
url: "https://www.webforum.nu/amne/php/73105-regular-expressions"
topic: "PHP"
topic_url: "https://www.webforum.nu/amne/php"
author: "ZeUs"
published: "2003-04-03T22:53:39.000Z"
updated: "2003-04-03T22:53:39.000Z"
replies: 0
views: 166
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/php/73105-regular-expressions"
---

# Regular expressions

## #1 — ZeUs, 2003-04-03T22:53Z

Jag har sökt endel på regular expressions och testat endel men jag får det inte att fungera...
Jag hade tänkt göra ett script som extraherar information från min skolas online schema. Jag har lyckats med att extrahera ut följande:

```php
<form>
      <TD VALIGN="TOP" ALIGN="LEFT" class="brodtext">2003-04-07_ Mån_</TD>
      <TD VALIGN="TOP" class="brodtext">10:00-11:45_</TD>
      <TD VALIGN="TOP" class="brodtext">Dm2   _</TD>
      <TD VALIGN="TOP" class="brodtext">IndEkEnt_</TD>
      <TD VALIGN="TOP" class="brodtext">_</TD>
      <TD VALIGN="TOP" class="brodtext">B102   JP-Aulan            
_</TD>
      <TD VALIGN="TOP" class="brodtext">WeBj_</TD>
      <TD VALIGN="TOP" class="brodtext">Föreläsning
      _</TD>
      <TD VALIGN="TOP" class="brodtext"> _ 
</TD>
</form>
  </TR>

<TR>

<form>
      <TD VALIGN="TOP" ALIGN="LEFT" class="brodtext">[2003-04-09]_[Ons]_</TD>
      <TD VALIGN="TOP" class="brodtext">[08:00-11:45]_</TD>
      <TD VALIGN="TOP" class="brodtext">[Dm2]   _</TD>
      <TD VALIGN="TOP" class="brodtext">[Systutv] _</TD>
      <TD VALIGN="TOP" class="brodtext">[B]_</TD>
      <TD VALIGN="TOP" class="brodtext">[E167] 
_[/blue]</TD>
      <TD VALIGN="TOP" class="brodtext">[StAr]_</TD>
      <TD VALIGN="TOP" class="brodtext">[Föreläsning]
      _</TD>
      <TD VALIGN="TOP" class="brodtext">[Labb]_
</TD>
</form>
...n
```

...n = betyder att det finns fler sådana poster

Jag vill kunna extrahera ut:
Dag, Tid, Prog, Kurs, Grp, Sal, Sign, Moment och Typ
Jag har märkt ut de poster som jag vill kunna extrahera med \[\]

Det finns ungefär 25 poster på hela sidan nu men det kan variera, jag vill alltså kunna hämta ut informationen från alla 25 posterna. Hoppas att jag varit tydlig...

Hur ska jag utforma uttrycket för att göra det möjligt?
Tack på förhand, vad  hade man gjort utan wF?  ;)

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

---

Tråden på webben: https://www.webforum.nu/amne/php/73105-regular-expressions
