RegEx : ReplaceRegularExpression
Posted: Thu Apr 24, 2008 4:19 pm
I try to learn to use the new regex but i just fall on a problem
Why doesn't this code run ?
Thanks for advance !
Why doesn't this code run ?
Code: Select all
String.s = "Hier ist eine Demo wie aus dem BB-Code "
String + "[URL=http://www.google.de]Google[/url] "
String + "oder diesem hier "
String + "[url=http://www.pure-board.de]Pure-Board[/URL] "
String + "ein HTML-Code wird."
If CreateRegularExpression(1, "(?i)\[URL=([^\[\]]+)\]([^\[\]]+)\[/URL\]")
Result.s = ReplaceRegularExpression(1, String, "<a href='?1'>\\2</a>")
Else
Result.s = RegularExpressionError()
EndIf
String2.s = "\pard\qc \pard\qd \pard\qr \pard\qs \pard\qj"
If CreateRegularExpression(2, "\\pard\\q[crj]")
Result2.s = ReplaceRegularExpression(2, String2, "<newpar \\1>")
Else
Result2.s = RegularExpressionError()
EndIf
Debug Result
Debug Result2