Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
This is the forum to discuss the Wrox book Beginning PHP5, Apache, and MySQL Web Development by Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass; ISBN: 9780764579660
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 23rd, 2007, 04:51 PM
Authorized User
 
Join Date: May 2006
Location: , , Australia.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Beebs
Default Adding regular expression (email+URL)

Chapter 16 :

Here's the forum_bbcode table :
[code

CREATE TABLE IF NOT EXISTS forum_bbcode (
id int(11) NOT NULL auto_increment,
template varchar(255) NOT NULL default '',
replacement varchar(255) NOT NULL default '',
PRIMARY KEY (id)
)ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `forum_bbcode`
--

INSERT INTO `forum_bbcode` VALUES (1,'\[b\]([^[]+?)\[\/b\]','<b>$1</b>');
INSERT INTO `forum_bbcode` VALUES (2,'\[i\]([^[]+?)\[\/i\]','<i>$1</i>');
INSERT INTO `forum_bbcode` VALUES (3,'\[u\]([^[]+?)\[\/u\]','[u]$1</u>');
INSERT INTO `forum_bbcode` VALUES (4,'\[url\]([^[]+?)\[\/url\]','<a href="$1" target="_blank">$1</a>');
INSERT INTO `forum_bbcode` VALUES (5,'\[url=(]+?)\]','<a href="$1" target="_blank">');
INSERT INTO `forum_bbcode` VALUES (6,'\[\/url\]','</a>');

[/code]

I need your help for :

1. How to add email regular expression ? This is my effort which give an error message :
Code:
INSERT INTO `forum_bbcode` VALUES (7,'\[email\](([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+))\[\/email\]','<a href=\"mailto:$1\">$1</a>');
2. How to change the style that was set from chapter 16 set for adding URL and email? I am talking about this style of email and URL :
Code:
<a href="mailto:myemail@mail.com">myemailtitle</a>
.

So that when user click on the email & URL icon they will be prompted to add their email/URL title and then the link.

3. I'll appreciate if you can help me to add regular expression for ordered amd unordered list
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
REGULAR EXPRESSION pallone Javascript How-To 0 September 5th, 2006 06:52 AM
Regular expression C# radhakrishnan1976 General .NET 1 February 19th, 2006 01:11 AM
regular expression if-then smay Javascript 4 July 5th, 2005 12:10 PM
Regular Expression Help Greg Griffiths Javascript How-To 4 November 12th, 2004 05:33 AM
help in regular expression diby Beginning PHP 1 September 17th, 2003 12:25 PM



All times are GMT -4. The time now is 08:11 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.