-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
Well in general your pattern is fine (except for the questionable range...I'm not sure how many numbers an ISBN can be either), except for I'm not 100% but I don't think SQL regex requires delimiters... but anyways, it seems to me except for the whole ISBN prefix he is looking for an exact match, not a pattern match...
-
Frost, you are just sexy in general. You ooze sexiness. If I weren't hopelessly heterosexual, I'd totally be all over you.
-
I'm not convinced you need regex for this...regex is pattern matching... it looks like you are wanting to select info from the database based on a number the user enters in...for example, you have the following: [pre] column: ISBN ------------ row: ISBN97345444 [/pre] user enters in "97345444" and this value is in $number You would just do something like (simplified sql statement): $sql = "SELECT * FROM TABLENAME WHERE ISBN = 'ISBN{$number}'";
-
If it makes you feel any better, most programmers (even professional programmers) run the other way at the mention of regex. It has a big learning curve. But if you keep at it, one day it will just click and make sense, like you have to overcome some event horizon or somethin'. After that it is pretty easy and you wonder why it seemed so hard before. IMO regex is one of the sexiest things about programming, but maybe that's just me
-
Okay so in this case, the ? is not entirely the same as "less greedy" (a.k.a "lazy"). What it means is "match 0 or 1 of the previous item or group". ~^(1|2|5|6|7)(\+|\|)?$~ [pre] ~ starting delimiter ^ signifies the beginning of the string (1|2|5|6|7) match 1 or 2 or 5 or 6 or 7 (\+|\|) match a literal + or | ? make the previous thing optional. In this case, it is the + or | $ signifies the end of the string ~ ending delimiter [/pre] So overall, it is matching a single number, followed by a an optional plus or pipe, and the ^ and $ are start and ending string anchors to signify the whole string ($number) can only be just one number and an optional + or |
-
yes they are the pattern delimiters, just like your /../ I just prefer to use ~..~ because then I don't have to escape instances of / in a pattern, which is especially convenient when trying to parse html.
-
if (preg_match('~^(1|2|5|6|7)(\+|\|)?$~',$number)) { // matched }
-
hmm...lifestyle choice for sure...as for me, I'd prefer being in a good relationship with one girl. Quality over quantity. Someone to laugh with and share adventures with, etc... I mean sure, shagging faceless girls at a brothel probably is a step up from being in an unhappy relationship. Keyword: unhappy. But hey whatever gets you off man...to each his own. But anyways, if you feel the need to be someone your not, in order to impress a girl...she's not the right girl for you in the first place. And seriously...if you are basing your ideals off of movies...especially American movies....wow...just...wow. p.s.- In real life (a.k.a not the movies), there aren't very many places in America where prostitution is actually legal. Like seriously, only a couple of places in all of America.
-
lol I don't think dreamwest is trolling...I just think he's...misguided? Hmm...what's a good word...
-
wait...100 hookers...hold up... there, now I'm ready...high five bra!
-
I know right? I'm not even really sure what's worth bragging about even if it were 100 random girls...I mean in my mind, at best I'd wonder how much of an asshole he was, smooth-talking ladies into a one-night-stand and then dumping their ass...and that's at best. At worst, I'd be wondering if he date raped most of them... but hookers? How the hell is that worthy of bragging about? That's not some major accomplishment...I'm more thinking you lack social skills, physical skills, looks, one or more of the above...something else...I mean damn dude...what were you expecting to get out of this thread, an internet high-five? zomg what up alpha-male-bra?? /chestbump
-
okay well...shagging 100 girls you randomly meet > shagging 100 hookers.... but I mean come on man, either way...is that something to really be proud of? What if tomorrow you meet the girl of your dreams and fall in love and then she finds out you slept with 100+ girls? There is a good possibility she's going to dump your ass...esp finding out they were hookers...
-
Chatroulette doesn't count. Please reset your counter and try again. haha burn
-
...and many people would argue the same about you still being on Windows XP...it was released like 9 years ago, and has been since replaced twice over...first with Vista (about 4 years ago) and now by Windows 7 (been out for over a year now...). No offense dude...if you wanna continue to use XP then more power to you, but I don't think you really have room to complain about IE9 not being compatible with XP.
-
I know right? Who the fuck do they think they are? There should be some kind of standard where you release something clearly labeled as a "trial" or "test" with the intention of finding and fixing random bugs and...oh wait...
-
IE6 will be the sole reason 50 years from now we aren't using a 3d VR internets. Also, the lack of people and abundance of zombies might have an impact.
-
If the delay in response somehow didn't already do it, the grammar of that response alone would have me packing my bags and going somewhere else. I understand that expert programmers does not necessarily equate to being an expert in writing, but a real hosting company would have a separate department that handles letters like that, especially as it could easily become evidence in legal battles. Poor timing and writing of response == company working out of a broom closet IMO.
-
Maybe you need to provide more info but... why don't you just output the link with www on it in the first place? Is that the code that gets output? just change ...<a href="http://hostelsuit.... to ...<a href="http://www.hostelsuit...
-
There are a couple of prefab php functions for parsing url strings....you can do something like this: function getQueryParam($url,$param) { $query = parse_url((string)$url); parse_str($query['query'],$query); return (isset($query[$param])) ? $query[$param] : false; } $url = "http://www.megaupload.com/?d=N241NIPD"; $d = getQueryParam($url,'d'); echo $d; But if you want to do it with regex (based on that url given, no other "rules" for what it could be...): $url = "http://www.megaupload.com/?d=N241NIPD"; preg_match('~http://www\.megaupload\.com/\?d=([a-z0-9]{8})~i',$url,$d); echo $d[1];
-
Same here, fuck, fuckin up your holiday. You explicitly told them what to do, you've got all the right to ignore... go have a beer Though, I could see where you might worry about them screwing everything up before you get back, that would blow. Yeah it's the 2nd part that always gets me to respond in the end. Whenever I'm OOO and I get emails like that my first thought is to ignore it and be like fuck that, this is my time off, but then I think about how fucked it will be when I get back because it will just be there waiting for me the whole time, simmering to a nice level of "bend me over and jam it in"