Regex strtolower

Pagina: 1
Acties:

  • chuxiej
  • Registratie: Februari 2001
  • Laatst online: 13-07-2020
ik heb een regex:
PHP:
1
$txt = preg_replace( "#\\[ra2_player\](.+?)\\[/ra2_player\]#is", "<a href='http://games2.westwood.com/ra2gamelogs/\\1.html' target='_blank'>\\1</a>", $txt );


Dit werkt wel maar nu wil ik ucfirst en strtolower toevoegen

Dit lukt niet:
PHP:
1
$txt = preg_replace( "#\\[ra2_player\](.+?)\\[/ra2_player\]#is", "<a href='http://games2.westwood.com/ra2gamelogs/ucfirst(strtolower(\\1)).html' target='_blank'>\\1</a>", $txt );


Weet iemand een oplossing hiervoor?

www.dannyhiemstra.nl


  • CTVirus
  • Registratie: Januari 2000
  • Laatst online: 26-08 14:37

CTVirus

Dexterslab FAN

#ise", "<a href=\'http://games2.westwood.com/ra2gamelogs/'.ucfirst(strtolower(\\1)).'html\' target=\'_blank\'>\\1</a>",

dit zou moeten werken, weet iemand waarom dit niet werkt:

PHP:
1
preg_replace("/(.*)\\[I\]([\S]+)\\[\/I\](.*)/e","ubb_to_html_reg('\\0').'<i>'.ubb_to_html_reg('\\1').'<\i>'.html_to_ubb_reg('\\2')",$bericht);

?

[ Voor 52% gewijzigd door CTVirus op 10-12-2002 18:44 ]


  • chuxiej
  • Registratie: Februari 2001
  • Laatst online: 13-07-2020
Ik heb nu:
PHP:
1
2
$txt = preg_replace( "#\\[ra2_player\](.+?)\\[/ra2_player\]#ise", "<a href=\'http://games2.westwood.com/ra2gamelogs/'.ucfirst(strtolower(\\1)).'.html\' target=\'_blank\'>\\1</a>", $txt);
$txt = preg_replace( "#\\[ra2_clan\](.+?)\\[/ra2_clan\]#ise", "<a href=\'http://games2.westwood.com/ra2gamelogs/'.strtoupper(\\1).'.html\' target=\'_blank\'>\\1</a>", $txt);


Maar nu krijg ik deze error:
code:
1
2
3
Parse error: parse error in /www/htdocs/chatstar/forum/sources/lib/post_parser.php(210) : regexp code on line 1

Fatal error: Failed evaluating code: ASMARTKID in /www/htdocs/chatstar/forum/sources/lib/post_parser.php on line 210

[ Voor 13% gewijzigd door chuxiej op 10-12-2002 18:48 . Reden: paar tabjes weghalen ]

www.dannyhiemstra.nl


  • CTVirus
  • Registratie: Januari 2000
  • Laatst online: 26-08 14:37

CTVirus

Dexterslab FAN

als je die \' in \" verandert dan kan het daar ieg niet aan liggen

  • chuxiej
  • Registratie: Februari 2001
  • Laatst online: 13-07-2020
ok die eerste werkt nu maar alleen deze niet:
PHP:
1
$txt = preg_replace( "#\\[ra2_clan\](.+?)\\[/ra2_clan\]#ise", "'<a href=\"http://games2.westwood.com/ra2gamelogs/clan_\\['.strtoupper(\\1).'\].html\" target=\"_blank\">\\1</a>'", $txt);


Dan krijg ik deze error:
code:
1
2
3
Parse error: parse error in /www/htdocs/chatstar/forum/sources/lib/post_parser.php(211) : regexp code on line 1

Fatal error: Failed evaluating code: '@c-s@' in /www/htdocs/chatstar/forum/sources/lib/post_parser.php on line 211

www.dannyhiemstra.nl


  • CTVirus
  • Registratie: Januari 2000
  • Laatst online: 26-08 14:37

CTVirus

Dexterslab FAN

clan_\\['.strtoupper(\\1).'\].html\"

Ik denk dat het daar in zit maar ik zou niet weten wat, weet jij waarom deze het niet doet:
preg_replace("/(a*)hup(b*)hop(c*)/e","ubb_to_html_reg('$0').'<i>'.ubb_to_html_reg('$1').'<\i>'.html_to_ubb_reg('$3')",$bericht);

  • chuxiej
  • Registratie: Februari 2001
  • Laatst online: 13-07-2020
ik denk hieraan:
preg_replace(("#/(a*)hup(b*)hop(c*)/e#ise",

www.dannyhiemstra.nl


  • CTVirus
  • Registratie: Januari 2000
  • Laatst online: 26-08 14:37

CTVirus

Dexterslab FAN

aha hoe zit dat met dat hekje enzo??

  • chuxiej
  • Registratie: Februari 2001
  • Laatst online: 13-07-2020

www.dannyhiemstra.nl

Pagina: 1