
![]() |
m0nkeymafia
first of all you guys rock, i actually freel [more] comfortable with
regexnow after you guys helpin meanyway 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 regexto do it, simply by doing ereg_replace('(^[A-z]+)','',$var); will remove all non characters from $var, which is uber cool! btw im writing thatregexfrom memory it may be slightly off, but still, i thought id share the loveta ta perkiset
Congrats on the
Regexstrength 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?m0nkeymafia
well my
regexskills are to the point where I can cobble something together, i dont really know the difference between the twowhat is the difference? lol perkiset
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
PERLcompatible 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? vsloathe
In another language I use, I pretty much always set the flag to return the results of a String
Regex() inPHP/Perlmode. FWIWnutballs
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. m0nkeymafia
nice one balls
|

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads