Alex.
Account Closed
- Impact
- 5
BUMP WILL GIVE 20NP FOR QUICK ANSWER,
Can anyone tell me what the POSIX expression for any character is?
I'm trying
But that gives me:
Instead of:
All I need is an expression that will grab any character.
So I could ask it to parse
into
Can anyone tell me what the POSIX expression for any character is?
I'm trying
Code:
$data = ereg_replace('<b([^.]+)>','[b]',$data);
Fixed a bug that disconnected some....
Instead of:
Code:
[/b]Bug Fixes[/b]<ul class="bullet-list"><li>Fixed a bug that disconnected some....
All I need is an expression that will grab any character.
So I could ask it to parse
Code:
<b class="subhead">Bug Fixes[/b]<ul class="bullet-list"><li>Fixed a bug that di
Bug Fixes
- Fixed a bug that di
Thanks
Alex
Old post:
Hi,
I'm trying to make something that will parse html to bbcode.
This is my test code atm:
Code:<?php function myparse($data){ $data = htmlspecialchars_decode($data); $data = eregi_replace('<a href="(([[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]))">','[url=\\0]',$data); $data = htmlspecialchars($data); return $data; } echo myparse('<a href="http://us.rd.yahoo.com/dailynews/rss/movies/*http://news.yahoo.com/s/ap/20070527/ap_en_mo/france_cannes_awards">'); ?>
Now this just prints
Code:[url=<a href="http://us.rd.yahoo.com/dailynews/rss/movies/*http://news.yahoo.com/s/ap/20070527/ap_en_mo/france_cannes_awards">]
I'd like it to print:
Code:[url=http://us.rd.yahoo.com/dailynews/rss/movies/*http://news.yahoo.com/s/ap/20070527/ap_en_mo/france_cannes_awards]
Help is appreciated
Thanks
Alex
Last edited: