Thread: Regular expressions

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    New York
    Posts
    1,905

    Regular expressions

    I'm stumped working with regular expressions in php...I'm trying to convert the following:

    [color=blue]

    to:

    <font color="blue">


    and I've tried doing this in php:

    Code:
    $text = eregi_replace("\[color=+([[:alpha:]])+\]","&lt;font color=\"\\1\">",$text);
    which gave me:

    <font color="e">

    so....I'm stumped, as I don't know how to grab the string "red" from [color=red]....anyone here good with regular expressions? I've just started working with 'em today and I'm still trying to figure 'em out.
    Last edited by jverkoey; 01-23-2005 at 04:55 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Regular expressions [Boost]
    By Desolation in forum C++ Programming
    Replies: 8
    Last Post: 12-30-2006, 10:10 PM
  2. Regular expressions
    By JimpsEd in forum C Programming
    Replies: 5
    Last Post: 05-13-2006, 06:01 PM
  3. Help please: regular expressions in C++
    By reivaj7999 in forum C++ Programming
    Replies: 3
    Last Post: 08-24-2005, 01:11 AM
  4. Regular Expressions
    By Korn1699 in forum C# Programming
    Replies: 4
    Last Post: 01-12-2005, 12:50 AM
  5. regular expressions help
    By axon in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 09-09-2004, 07:16 PM