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
.
February 11, 2012, 02:08:18 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home (Index)
Level 2 Cache: Speciality Items
Regex
clean urls baby
Pages: [
1
]
« previous
next »
Print
Author
Topic: clean urls baby (Read 2337 times)
m0nkeymafia
Expert
Offline
Posts: 240
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: 9792
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
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
m0nkeymafia
Expert
Offline
Posts: 240
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: 9792
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
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
vsloathe
vim ftw!
Global Moderator
Lifer
Offline
Posts: 1669
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
hai
nutballs
Administrator
Lifer
Offline
Posts: 5604
Back in my day we had 9 planets
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
I could eat a bowl of Alphabet Soup and shit a better argument than that.
m0nkeymafia
Expert
Offline
Posts: 240
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:
-----------------------------
Level 1 Cache: General Discussion
-----------------------------
=> Init() - New Member Introductions
=> NEW BOARD: The n00b Zone
=> Callback Routines
=> Recovered Sectors
=> freemem() & Garbage Collection
=> All Things General Tech
=> All Things Android
=> All Things Apple
=> All Things Database
=> All Things Microsoft
=> All Things *nix
-----------------------------
Level 2 Cache: Speciality Items
-----------------------------
=> AJAX
=> ASP & .NET
=> C/++/#/Objective, Java, ObjectPascal
=> CSS, HTML & SEO, Cloaking
=> JavaScript
=> Music Technology
=> PERL
=> PHP
=> Obscurites, Curiosities & Arcanity
=> Regex
-----------------------------
Frameworks, Applications & Projects
-----------------------------
=> phpMyIDE
=> The iPhone SMF Theme Project
=> SMF
-----------------------------
Retired Boards
-----------------------------
=> ColdFusion
=> phpMyIDE
=> SalesForce / Apex
=> Javascript Code Repository & Examples
=> PHP Code Repository / Examples
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...