[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 379: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 379: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Webmasterplein.net • Toon onderwerp - [WMP-TOOL] regex tester
aan alle goede dingen komt een eind, webmasterplein.net 2003 - 2013
wij danken jullie voor al mooie momenten die dankzij dit forum ontstonden - Derk, Rutger en Stef

[WMP-TOOL] regex tester

Je komt er niet helemaal uit bij het scripten? Übergoede functie geschreven? Alles met betrekking tot scripting, kun je hier terecht.

Re: [WMP-TOOL] regex tester

Berichtdoor ElbertF » 25 feb 2008 13:18

Hij zegt "unknown modifier ^", terwijl ^ er maar één keer in staat en wel aan het begin van de regex waar die hoort. Wat klopt daar niet aan dan? Als ik het in PHP test werken alle URL's.

Ik zie trouwens dat jouw regex dat niet heeft, waardoor hij "blahttp://webmasterplein.net" gewoon goedkeurt.

Edit: het gaat blijkbaar fout omdat ik / en / gebruik (zonder werkt het wel). Maar zonder begin- en eindtekens kun je geen modifiers (i, u, s etc.) opgeven.

Edit 2:

Dit staat in je code en klopt dus niet, inplaats van een slash kun je ook een ander teken gebruiken namelijk wat soms beter uitkomt (en zo kun je zoals ik al zei geen modifiers kwijt).
Avatar gebruiker
ElbertF
wmpr
 
Berichten: 1310
Geregistreerd: 14 nov 2007 22:09

Re: [WMP-TOOL] regex tester

Berichtdoor Remi » 25 feb 2008 13:32

Avatar gebruiker
Remi
wmpr
 
Berichten: 3010
Geregistreerd: 04 apr 2006 15:22

Re: [WMP-TOOL] regex tester

Berichtdoor libia » 25 feb 2008 14:01

ja, lezen aub :)

ik had al gezegt dat er error's kwamen bij een foute regex en idd moet het zonder / en / ;) dit heb ik gedaan omdat het in andere talen (de meeste iig) niet hoeft en dus niet verwarrend is
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: [WMP-TOOL] regex tester

Berichtdoor ElbertF » 25 feb 2008 16:06

Eh dan kun je dus geen regex met newlines etc. testen of ungreedy maken. Ook moet je altijd slashes escapen wat niet hoeft als je @ of iets anders als modifier gebruikt zoals veel mensen doen. Je maakt het al erg lastig als je bijv. een regex wilt maken die bijv. tags uit HTML vist. Als ik wat regex voorbeelden erbij zet moeten ze het wel doen in onze tester hè. :razz:
Avatar gebruiker
ElbertF
wmpr
 
Berichten: 1310
Geregistreerd: 14 nov 2007 22:09

Re: [WMP-TOOL] regex tester

Berichtdoor libia » 25 feb 2008 16:09

nou, dan doe je dat :P
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: [WMP-TOOL] regex tester

Berichtdoor ElbertF » 26 feb 2008 10:08

Ikke? :P
Avatar gebruiker
ElbertF
wmpr
 
Berichten: 1310
Geregistreerd: 14 nov 2007 22:09

Re: [WMP-TOOL] regex tester

Berichtdoor libia » 26 feb 2008 11:44

ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: [WMP-TOOL] regex tester

Berichtdoor ElbertF » 26 feb 2008 11:45

Ik geef alleen maar een tip voor jouw tool. :(
Avatar gebruiker
ElbertF
wmpr
 
Berichten: 1310
Geregistreerd: 14 nov 2007 22:09

Re: [WMP-TOOL] regex tester

Berichtdoor libia » 26 feb 2008 12:14

ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: [WMP-TOOL] regex tester

Berichtdoor ElbertF » 26 feb 2008 12:18

Avatar gebruiker
ElbertF
wmpr
 
Berichten: 1310
Geregistreerd: 14 nov 2007 22:09

Re: [WMP-TOOL] regex tester

Berichtdoor libia » 26 feb 2008 12:25

maar dan moeten we hier wel php 5 hebben (hebben we dat?)

en die van phpbb zelf, die weergeeft de error's boven aan de pagina (typ maar een verkeerde regex in ;) )
en ik wil een duidelijk bericht, want de gebruiker hoeft niet te weten waar het fout ging, maar dat het fout ging :P
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: [WMP-TOOL] regex tester

Berichtdoor ElbertF » 26 feb 2008 12:33

We draaien PHP 5. :}
Avatar gebruiker
ElbertF
wmpr
 
Berichten: 1310
Geregistreerd: 14 nov 2007 22:09

Re: [WMP-TOOL] regex tester

Berichtdoor libia » 26 feb 2008 14:14

ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: [WMP-TOOL] regex tester

Berichtdoor ElbertF » 26 feb 2008 16:45

Avatar gebruiker
ElbertF
wmpr
 
Berichten: 1310
Geregistreerd: 14 nov 2007 22:09

Re: [WMP-TOOL] regex tester

Berichtdoor Stef » 26 feb 2008 19:11

Avatar gebruiker
Stef
wmpr
 
Berichten: 5575
Geregistreerd: 27 nov 2003 21:51

Re: [WMP-TOOL] regex tester

Berichtdoor libia » 26 feb 2008 20:20

is goed :) ik zal m'n best doen :D


ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: [WMP-TOOL] regex tester

Berichtdoor libia » 26 feb 2008 22:20

ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: [WMP-TOOL] regex tester

Berichtdoor Stef » 26 feb 2008 23:14

nah, gaat niet werken. ik kijk morgen zelf wel.
Avatar gebruiker
Stef
wmpr
 
Berichten: 5575
Geregistreerd: 27 nov 2003 21:51

Re: [WMP-TOOL] regex tester

Berichtdoor libia » 28 feb 2008 11:01

oke,

alvast bedankt :)
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: [WMP-TOOL] regex tester

Berichtdoor BetaDevil » 29 feb 2008 18:35

Ik ben bezig met een bbcode parser, en nu heb ik een paar strings.






Hoe kan ik nu kijken of er een = aan het einde staat dmv ?
BetaDevil
wmpr
 
Berichten: 362
Geregistreerd: 27 nov 2007 18:51

Re: [WMP-TOOL] regex tester

Berichtdoor libia » 29 feb 2008 20:08

[code=php]<?php
$value = preg_replace("/\[b\](.+?)\[\/b\]/is", "<b>\\1</b>", $value); //Bold
$value = preg_replace("/\[u\](.+?)\[\/u\]/is", "<u>\\1</u>", $value); //Underline
$value = preg_replace("/\[i\](.+?)\[\/i\]/is", "<i>\\1</i>", $value); //italic
$value = preg_replace("/\[url=([^\]]+)\](.+?)\[\/url\]/is", "<a href=\"\\1\" target=\"_blank\">\\2</a>", $value); //a (link)
$value = preg_replace("/\[url\](.+?)\[\/url\]/is", '<a href="\\1" target=\"_blank\">\\1</a>', $value); //a (link)
$value = preg_replace("/\[img\](.+?)\[\/img\]/is", '<img src="\\1" alt="afbeelding" />', $value); //image (no specified alt)
$value = preg_replace("/\[img=([^\]+])\](.+?)\[\/img\]/is", '<img src="\\2" alt="\\1" />', $value); //image (specified alt)
?>
zo heb ik het gedaan, zo ongeveer wordt het meestal gedaan trouwens..
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: [WMP-TOOL] regex tester

Berichtdoor BetaDevil » 29 feb 2008 20:24

Zo word het inderdaad gedaan, nu wil ik, met mijn inovatieve geest, het graag op een andere manier doen. :roll:
BetaDevil
wmpr
 
Berichten: 362
Geregistreerd: 27 nov 2007 18:51

Re: [WMP-TOOL] regex tester

Berichtdoor ElbertF » 29 feb 2008 20:29



Zoiets?
Avatar gebruiker
ElbertF
wmpr
 
Berichten: 1310
Geregistreerd: 14 nov 2007 22:09

Re: [WMP-TOOL] regex tester

Berichtdoor BetaDevil » 29 feb 2008 20:32

BetaDevil
wmpr
 
Berichten: 362
Geregistreerd: 27 nov 2007 18:51

Re: [WMP-TOOL] regex tester

Berichtdoor ElbertF » 29 feb 2008 20:38

Ik vat het niet helemaal maar controleert op een '=' op een willekeurige plaats en de 'i' van 'case insensitive' heeft hier geen functie. Met een '$' controleer je het laatste teken, en de '=' hoef je niet te escapen: . Je kan trouwens ook gewoon controleren (lichter).
Avatar gebruiker
ElbertF
wmpr
 
Berichten: 1310
Geregistreerd: 14 nov 2007 22:09

VorigeVolgende

Keer terug naar PHP, ASP, SQL



cron