General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old February 9th, 2003, 09:58 PM
Phod Phod is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 2 Phod User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Regular Expressions

Hey, I'm fairl adept with PHP and recently while trying to install Linux on my laptop i came accross regular expressions!! wow, these are soo cool....or so i hear - a friend pointed me at the tutorial and its great for validating string...but you don't say anyhing on using it in preg_replace() I'm trying to compress my html source into a format where there are no newlines, just any existing spaces before/after > and < so it would look something like this:

<html> <head> <title> This is the Title - Note The Sopace After the title tag </title> </head> </html>

thats the plan anyhow i think the search strig shoudl look something like this:

^(>[[:space:]][[:space:]])

and the replace string something like this:

^(>[[:space:]])

I figure if I only check for "< " (with 2 spaces after the < ) then I won't erase spaces after the tabs like <strong>



eg

welcome to<strong> site name</strong> new user


I'd just like i note on the preg_()/egreg_() differences and a lil' piece on using reg expressions for replacment like that

btw..nice tutorial - ony one thats made ANY sense!!

Last edited by Phod : February 9th, 2003 at 10:08 PM.

Reply With Quote
  #2  
Old February 13th, 2003, 08:17 AM
Phod Phod is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 2 Phod User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hey i sorted it

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Regular Expressions


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway