Can anyone help me find a regular expression for faster fast link links
http: //rapidshare.com/#!download=943dt|421184201:Tools.rar:7316 I have to do something like this
< Code> $ Str = 'blah http://rapidshare.com/#!download|943dt|421184201|Tools.rar|7316 blah'; If (preg_match_all ('#http: // rapidshare \ .com / #! Download | (* *) | ([^ \ S] +) #', $ str, $ m) {var_dump ($ m); } Result
`
array 0 = & gt; Array 0 = & gt; String 'http://rapidshare.com/#!download|943dt|421184201|Tools.rar|7316' (length = 51) 1 = & gt; Array 0 = & gt; String '943dt' (length = 5) 2 = & gt; Array 0 = & gt; String '421184201' (length = 8) 3 = & gt; Array 0 = & gt; String 'Tools.rar' (length = 8) 4 = & gt; Array 0 = & gt; String '7316' (length = 8) `
Would you please try this reggae Can: $ str = 'blah http://rapidshare.com/#!download|943dt|421184201|Tools.rar|7316 Bla'; If (preg_match ('@http: //rapidshare.com/#! Download \ | ([^ \ |] +) \ | ([^ \ | | +) \ | ([^ \ | | +) \ | ( [^ \ | \ S] +) @ ', $ str, $ m) {var_dump ($ m); } // print array (5) {[0] = & gt; String (63) "http://rapidshare.com/#!download|943dt|421184201|Tools.rar|7316" [1] = & gt; String (5) "943 dt" [2] = & gt; String (9) "421184201" [3] = & gt; String (9) "Tools.Rar" [4] = & gt; String (4) "7316"} update
was not aware of the presence of new characters in the text. If this is the case before matching the regex before adding the new line characters before using the code below:
preg_match ('@http: //rapidshare.com/#! \ | ([^ \ |] +) \ | ([^ \ | | +) \ | ([^ \ | | +) \ | ([^ \ | \ S] +) @ ', Straw_rellist ("\ n "," ", $ Str), $ m)
Comments
Post a Comment