What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [PHP] Help with regular expressions

[PHP] Help with regular expressions
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
O.P. RE: [PHP] Help with regular expressions
Thanks -dt-, but I have some other problems I think... :P
code:
$smileys_from = array("<:o)", ":)", ":-)", ":D", ":d", ":>", ";)", ";-)", ":o", ":O", ":-O", ":P", ":p", ":-p", ":-P", "(h)", "(H)", ":@", ":-@", ":$", ":-$", ":s", ":S", ":-S", ":-s", ":-(", ":(", ":<", ":'(", ":|", ":-|", "(6)", "(A)", "(a)", "(L)", "(l)", "(U)", "(u)", "(m)", "(M)", "(@)", "(&)", "(S)", "(*)", "(~)", "(8)", "(E)", "(e)", "(F)", "(f)", "(w)", "(W)", "(O)", "(o)", "(K)", "(k)", "(G)", "(g)", "(^)", "(p)", "(P)", "(i)", "(I)", "(C)", "(c)", "(t)", "(T)", "({)", "(})", "(B)", "(b)", "(D)", "(d)", "(Z)", "(z)", "(x)", "(X)", "(y)", "(Y)", "(n)", "(N)", ":[", ":-[", "(?)", "(%)", "(#)", "(R)", "(r)", ":-#", "8o|", "8-|", "^o)", ":-*", "+o(", "(sn)", "(tu)", "(pl)", "(||)", "(pi)", "(so)", "(au)", "(ap)", "(um)", "(ip)", "(co)", "(mp)", "(brb)", "(st)", "(yn)", "(h5)", "(mo)", "(bah)", ":^)", "*-)", "(li)", "8-)", "(ci)", "(xx)", "(nah)", "|-)");

function stripplus($string) {
    $search = array("[b]","[/b]","[u]","[/u]","[s]","[/s]","·#","·@","·'","·0");
    $string = str_replace($search, "", $string);
    foreach($smileys_from as $value) {
        $cur = "·!" . $value;
        $string = str_replace($cur, "", $string);
    }
    $string = preg_replace("/\[c=(\d{1,2})\]/", "", $string);
    $string = preg_replace("/\[\/c.*?\]/", "",$string);
    $string = preg_replace("/·\$[0-9]{1,2}/", "", $string);
    return $string;
}

$psm = stripplus("Test ·$4one·0 ·$2two·0 ·$8three·0... ·#bold·# ·@underlined·@ ·!:P ·!:)");

This is my function, and my smiley array. This function, however, only succeeds to execute the first 2 lines. All the other lines fail... :(

Any idea?

This post was edited on 06-24-2006 at 03:11 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-24-2006 03:07 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[PHP] Help with regular expressions - by Matti on 06-24-2006 at 02:39 PM
RE: [PHP] Help with regular expressions - by -dt- on 06-24-2006 at 02:45 PM
RE: [PHP] Help with regular expressions - by Matti on 06-24-2006 at 03:07 PM
RE: [PHP] Help with regular expressions - by surfichris on 06-24-2006 at 03:10 PM
RE: [PHP] Help with regular expressions - by Matti on 06-24-2006 at 03:12 PM
RE: [PHP] Help with regular expressions - by hmaster on 06-24-2006 at 03:34 PM
RE: [PHP] Help with regular expressions - by surfichris on 06-24-2006 at 03:38 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On