The Syndk8 - Black Hat SEO Paradise
Fantomaster - Industrial Strength Black Hat SEO Tools
Affiliate Earners: Affiliate Programs
Home
Help
Search
Login
Register
RSS for SEOIdiot
Welcome,
Guest
. Please
login
or
register
.
November 21, 2008, 01:56:40 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home (Index)
Code Repository
Regex
clean urls baby
Pages: [
1
]
« previous
next »
Print
Author
Topic: clean urls baby (Read 1139 times)
m0nkeymafia
Expert
Offline
Posts: 236
Check it!
clean urls baby
«
on:
September 03, 2007, 08:26:59 AM »
first of all you guys rock, i actually freel [more] comfortable with regex now after you guys helpin me
anyway i know this is lame but im well happy so should post anyway
in order to get clean urls, i.e. say a link to an article but without the crap you dont want like brackets and whatnot i used to do a str_replace on abunch of bad character, and i thought that was snazzy.
but it dawned on me that I could use a simple regex to do it, simply by doing ereg_replace('(^[A-z]+)','',$var); will remove all non characters from $var, which is uber cool! btw im writing that regex from memory it may be slightly off, but still, i thought id share the love
ta ta
Logged
I am Tyler Durden
perkiset
Olde World Hacker
Administrator
Lifer
Online
Posts: 5142
:sniffle: Humor was so much easier before.
Re: clean urls baby
«
Reply #1 on:
September 03, 2007, 09:11:13 AM »
Congrats on the Regex strength MM - it does rock.
And BTW you're right, the regex _replace functions are really handy - may I ask why you went with ereg_replace rather than preg_replace? I thought from my reading that overall the preg_ functions were safer... thoughts?
Logged
If I can't be Mr. Root then I don't want to play.
m0nkeymafia
Expert
Offline
Posts: 236
Check it!
Re: clean urls baby
«
Reply #2 on:
September 03, 2007, 09:48:15 AM »
well my regex skills are to the point where I can cobble something together, i dont really know the difference between the two
what is the difference? lol
Logged
I am Tyler Durden
perkiset
Olde World Hacker
Administrator
Lifer
Online
Posts: 5142
:sniffle: Humor was so much easier before.
Re: clean urls baby
«
Reply #3 on:
September 03, 2007, 09:53:36 AM »
Well, the dox say the ereg are "Posix Extended" WTF that means... but all over the dox page it points to the preg functions which are PERL compatible and seem to be more active in both discussion and capabilities. I've just always used them because the tone of the ereg funcs seemed either specialized or in some way less robust...
Looking for anyone with an opinion here... WebProfessor perhaps?
Logged
If I can't be Mr. Root then I don't want to play.
vsloathe
vim ftw!
Global Moderator
Lifer
Online
Posts: 596
Re: clean urls baby
«
Reply #4 on:
October 09, 2007, 01:51:48 PM »
In another language I use, I pretty much always set the flag to return the results of a StringRegex() in PHP/Perl mode. FWIW
Logged
link buying service
link building service
nutballs
Administrator
Lifer
Online
Posts: 3384
Re: clean urls baby
«
Reply #5 on:
October 09, 2007, 07:21:05 PM »
posix extended means you can do this i think.
[[:digit:]]
not worth it. preg_XXXXXXX is faster from what I have read and in my quick simple testing.
Logged
m0nkeymafia
Expert
Offline
Posts: 236
Check it!
Re: clean urls baby
«
Reply #6 on:
October 11, 2007, 08:40:31 AM »
nice one balls
Logged
I am Tyler Durden
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Welcome to The Cache
-----------------------------
=> Init() - New Member Introductions
=> Efficient Cache Access Functions (aka User Tips)
=> I/O Protocols (Forum Rules)
=> Callback Routines
=> Coder's World Beat
=> The Tao of Programming
=> freemem() & garbage collection
-----------------------------
phpMyIDE
-----------------------------
=> Announcements & Updates
=> Support Threads
=> Tips, Tricks & Techniques
-----------------------------
Discussion Boards
-----------------------------
=> AJAX
=> ASP & .NET
=> C/++/#, Java, Delphi and other heavies
=> ColdFusion
=> Database Discussion (MySQL, Oracle and such)
=> General Discussion
=> JavaScript
=> Mac & iPhone Stuff
=> Music & Music Technology
=> PERL Coding & Best Practices
=> PHP
=> Python, Lisp/Scheme
=> *n[ui]x & OS-X
=> SMF Discussion
=> All things Windows
-----------------------------
Code Repository
-----------------------------
=> C / C++ / C#
=> ASP / .NET
=> Cold Fusion
=> Javascript & AJAX
=> Lisp (++Scheme) and such
=> PERL
=> PHP
=> Python
=> Regex
=> Shell Scripting
Perkiset's Place Home
Best of The Cache
phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's
Pinkhat's Perspective
cache
mart
coder
programmers
ajax
php
javascript
Loading...