JAY6390
Members-
Posts
825 -
Joined
-
Last visited
Everything posted by JAY6390
-
"~subscriberCount='(\d+)'~" and "~media:thumbnail url='([^']+)'~" That should do it
-
<?php $xml = simplexml_load_file('http://video.news.com.au/feed.atom'); foreach( $xml->entry as $entry ) { echo "Link - {$entry->link->attributes()->href}<br>"; break; } ?> or possibly just <?php $xml = simplexml_load_file('http://video.news.com.au/feed.atom'); echo "Link - {$xml->entry[0]->link->attributes()->href}<br>"; ?>
-
That matches your supplied data just fine and outputs c=3-024426 Clearly your input data isn't the same as what you've supplied
-
'~<a\s+href="solo\.php\?op=nope&([^"]+)~'
-
Couldn't you just add ? after the .+ /(Apple|Orange): (?P<extract>.+?)(\d{1,2} \w{3} \d{4})? http/ so that it's not greedy
-
you'll only need the space in there if you want to allow spaces as well Also, you don't need the ( ) around it unless you want to capture the string (which is kinda pointless since you are supplying the string in the first place)
-
echo preg_match("/^([A-Z0-9.,']+)$/", $string);
-
Using just numbers (especially the time) makes it very easy to brute crack (since you just need to enter a date range and let a foreach work it's magic). It also doesn't actually satisfy the part the OP asked about NOT having 1 or 0 in the password. I know they wont have the confusion issue with 1 l and L but it's still a bad idea to have just numbers, especially based on time, or a hex/hash of that time. Its also worth noting that unless this is being done manually for each password, if a script does 20 accounts at once, they would all have the same password as time() doesn't change during the running of the script like microtime does
-
No problem
-
This is what the last regex matches, (the ones in yellow/blue are valid) http://screencast.com/t/x9PmK3VOgB5 It seems to satisfy all of your above requirements, note that two dashes in a row won't work
-
Oops, the dash at the end hadn't been accounted for, here's the proper one ~^(?!-)(\d[\s-]?){1,}(?<!-)$~
-
I see. OK well this should satisfy those three points ~^(?!-)(\d[\s-]?){1,}$~
-
You can use trim to remove the dashes from either side too $new_subject = trim($subject, ' -'); To match that with regex then use if(preg_match('~^\d{3}-\d{3} \d{2}$~', $new_subject)) { // matched successfully code here } else { // Failed to match code here } This of course assumes you want to have the dash and space between the numbers exactly as you have it
-
fair enough. didn't think you'd need that if you have it only matching url's that start user/000000-username but yeah you can add that bit on too if you like
-
if (preg_match('%<a href="user/\d+-([^"]+)"%', $subject, $matches)) { $result = $matches[1]; } else { $result = ""; }
-
No problem
-
Also, if you want the output lowercase, use strtolower()
-
Nope, trim removes any of those characters from the start and end until it finds one that isn't in the list. It outputs f-oo-oo
-
Since you're using php, you can forget the need for the regex at all, and just use $str = trim($str, '- '); in it's place
-
google There's no real answer, I've learnt from all over tbh
-
$subject = 'boolean com.xxx.xxx.xxx.setValue(int, String, String)'; if (preg_match('/([^\s]+)\s(com\.[^(]+)\.([^\.]+)\(([^)]+)\)/', $subject, $matches)) { echo 'Group 1: ' . $matches[1] . '<br />'; echo 'Group 2: ' . $matches[2] . '<br />'; echo 'Group 3: ' . $matches[3] . '<br />'; echo 'Group 4: ' . $matches[4] . '<br />'; }
-
$subject = 'boolean com.xxx.xxx.xxx.setValue(int, String, String)'; if (preg_match('/([^\s]+)\s(com\.[^(]+)\(([^)]+)\)/', $subject, $matches)) { echo 'Group 1: ' . $matches[1] . '<br />'; echo 'Group 2: ' . $matches[2] . '<br />'; echo 'Group 3: ' . $matches[3] . '<br />'; } Output: Group 1: boolean Group 2: com.xxx.xxx.xxx.setValue Group 3: int, String, String
-
$result = preg_replace('/(\{[a-z0-9_]+\})/i', '<span class="blah">$1</span>', $subject);
-
Just put $result = str_replace('-', ' ', $result); After the preg_replace line