Fetstil Fetstil Kursiv Understrykning linje färgläggning tabellverk Punktlista Nummerlista Vänster Centrerat högerställt Utfyllt Länk Bild htmlmode
  • Forum & Blog
    • Forum - översikt
      • .Net
        • asp.net generellt
        • c#
        • vb.net
        • f#
        • silverlight
        • microsoft surface
        • visual studio .net
      • databaser
        • sql-server
        • databaser
        • access
        • mysql
      • mjukvara klient
        • datorer och komponenter
        • nätverk, lan/wan
        • operativsystem
        • programvaror
        • säkerhet, inställningar
        • windows server
        • allmänt
        • crystal reports
        • exchange/outlook
        • microsoft office
      • mjukvara server
        • active directory
        • biztalk
        • exchange
        • linux
        • sharepoint
        • webbservers
        • sql server
      • appar (win/mobil)
      • programspråk
        • c++
        • delphi
        • java
        • quick basic
        • visual basic
      • scripting
        • asp 3.0
        • flash actionscript
        • html css
        • javascript
        • php
        • regular expresssion
        • xml
      • spel och grafik
        • DirectX
        • Spel och grafik
      • ledning
        • Arkitektur
        • Systemutveckling
        • krav och test
        • projektledning
        • ledningsfrågor
      • vb-sektioner
        • activeX
        • windows api
        • elektronik
        • internet
        • komponenter
        • nätverk
        • operativsystem
      • övriga forum
        • arbete karriär
        • erbjuda uppdrag och tjänster
        • juridiska frågor
        • köp och sälj
        • matematik och fysik
        • intern information
        • skrivklåda
        • webb-operatörer
    • Posta inlägg i forumet
    • Chatta med andra
  • Konto
    • Medlemssida
    • Byta lösenord
    • Bli bonsumedlem
    • iMail
  • Material
    • Tips & tricks
    • Artiklar
    • Programarkiv
  • JOBB
  • Student
    • Studentlicenser
  • KONTAKT
    • Om pellesoft
    • Grundare
    • Kontakta oss
    • Annonsering
    • Partners
    • Felanmälan
  • Logga in

Hem / Forum översikt / inlägg

Posta nytt inlägg


Set oMatches = regExp.Execute(strText) - Varför blir det fel?

Postades av 2003-03-26 11:30:56 - Linus Enbom, i forum regular expressions, Tråden har 5 Kommentarer och lästs av 1378 personer

Varför kommer detta fel upp?? Det funkar då jag sitter med min dator och pws men då jag laddar upp den så vill den inte fungera....

Detta fel kommer:
"Oväntad kvantifierare"
<code>
Set oMatches = regExp.Execute(strText)</code>
Ni Kan kolla hur felet ser ut på: http://www.ledare.net/users/norrbotten/
<code>
Function Fix(strText)
Dim regExp, oMatches, oMatch
Dim strMatch, strURLValue, strEmail
Dim strType, nNum

Set regExp = New regexp

regExp.Global = true
regExp.IgnoreCase = true

strText = Replace(Trim(strText),vbCrLf, "<br>")

'** Leta <nsf:>
regExp.Pattern = "<nsf:(.*?)>"
Set oMatches = regExp.Execute(strText)
For Each oMatch In oMatches
strMatch = oMatch.Value
strURLValue = oMatch.SubMatches(0)

If InStr(strURLValue, ":") = 0 Then
strText = Replace(strText, strMatch, "" & strURLValue & "")
End If
Next

'** Leta
regExp.Pattern = "(.*?)"
Set oMatches = regExp.Execute(strText)
For Each oMatch In oMatches
strMatch = oMatch.Value
strURLValue = oMatch.SubMatches(0)

If InStr(strURLValue, ":") = 0 Then
strText = Replace(strText, strMatch, "" & strURLValue & "")
Else
If Left(strURLValue, 7) = "mailto:" Then
strEmail = Right(strURLValue, Len(strURLValue) - 7)
strText = Replace(strText, strMatch, "" & strEmail & "")
Else
strText = Replace(strText, strMatch, "" & strURLValue & "")
End If
End If
Next

'Tecken Stilar
strText = Replace(strText,"[f]","<b>")
strText = Replace(strText,"[/f]","</b>")
strText = Replace(strText,"[k]","<i>")
strText = Replace(strText,"[/k]","</i>")
strText = Replace(strText,"[u]","<u>")
strText = Replace(strText,"[/u]","</u>")

'Färjer
strText = Replace(strText,"[red]","<font color='red'>")
strText = Replace(strText,"[/red]","</font>")
strText = Replace(strText,"[green]","<font color='green'>")
strText = Replace(strText,"[/green]","</font>")
strText = Replace(strText,"[blue]","<font color='blue'>")
strText = Replace(strText,"[/blue]","</font>")
strText = Replace(strText,"[yellow]","<font color='yellow'>")
strText = Replace(strText,"[/yellow]","</font>")
strText = Replace(strText,"[white]","<font color='white'>")
strText = Replace(strText,"[/white]","</font>")

Set oMatches = Nothing
Set regExp = Nothing

Fix = strText

End Function</code>


Svara

Sv: Set oMatches = regExp.Execute(strText) - Varför blir det fel?

Postades av 2003-03-26 11:41:59 - Andreas Hillqvist

Det finns en funktion som heter Fix i VB. Kan vara så att det koliderar. Testa att byta namn på din funktion.


Svara

Sv: Set oMatches = regExp.Execute(strText) - Varför blir det fel?

Postades av 2003-03-26 13:16:45 - Linus Enbom

Nej det är inte det som är felet.....
Det är just raden:
<code>
Set oMatches = regExp.Execute(strText)</code>
som felar.... vet inte varför... funkar på min dator i pws.....


Svara

Sv: Set oMatches = regExp.Execute(strText) - Varför blir det fel?

Postades av 2003-03-26 13:46:08 - Andreas Hillqvist

Det finns två rader som ser lika dana ut. Är det den första som inte fungerar?


Svara

Sv: Set oMatches = regExp.Execute(strText) - Varför blir det fel?

Postades av 2003-03-26 17:53:47 - Linus Enbom

Allt funkar då jag har det på min dator men då jag lägger upp det på servern så vill den inte fungera...

Ni kan kolla det på: http://www.ledare.net/users/norrbotten/default.asp


Svara

Sv: Set oMatches = regExp.Execute(strText) - Varför blir det fel?

Postades av 2003-03-27 14:10:02 - Patrik Andersson

För att vissa funktioner med RegEx skall funka så måste du ha den senaste VB script motorn installerad.

Du hittar den på http://msdn.microsoft.com/library/default.asp?url=/downloads/list/webdev.asp


Svara

Nyligen

  • 09:09 Vill du köpa medicinska tester?
  • 12:47 Vem beviljar assistansen – kommune
  • 14:17 Någon med erfarenhet av hemstädnin
  • 14:14 Bör man använda sig av en båtförme
  • 14:12 Finns det någon intressant hundblo
  • 14:25 Tips på verktyg för att skapa QR-k
  • 14:23 Tips på verktyg för att skapa QR-k
  • 20:52 Fungerer innskuddsbonuser egentlig

Sidor

  • Hem
  • Bli bonusmedlem
  • Läs artiklar
  • Chatta med andra
  • Sök och erbjud jobb
  • Kontakta oss
  • Studentlicenser
  • Skriv en artikel

Statistik

Antal besökare:
Antal medlemmar:
Antal inlägg:
Online:
På chatten:
4 569 153
27 952
271 704
849
0

Kontakta oss

Frågor runt konsultation, rådgivning, uppdrag, rekrytering, annonsering och övriga ärenden. Ring: 0730-88 22 24 | pelle@pellesoft.se

© 1986-2013 PelleSoft AB. Last Build 4.1.7169.18070 (2019-08-18 10:02:21) 4.0.30319.42000
  • Om
  • Kontakta
  • Regler
  • Cookies