Advertisement
Guest User

Untitled

a guest
Jan 11th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.68 KB | None | 0 0
  1. The regular expression:
  2.  
  3. (?-imsx:((http(v|vh|vhd)?://)?([a-zA-Z0-9\-\_]+\.|)?youtube\.com/watch(\?v\=|/v/|#!v=)([a-zA-Z0-9\-\_]{11})([^<\s]*))|((http(v|vh|vhd)?://)?([a-zA-Z0-9\-\_]+\.|)?youtu\.be/([a-zA-Z0-9\-\_]{11}))|((http(v|vh|vhd)?://)?([a-zA-Z0-9\-\_]+\.|)?metacafe\.com/watch/([a-zA-Z0-9\-\_]{7})/([^<^/\s]*)([/])?)|((http(v|vh|vhd)?://)?([a-zA-Z0-9\-\_]+\.|)?vimeo\.com/([a-zA-Z0-9\-\_]{8})([/])?)|((http(v|vh|vhd)?://)?([a-zA-Z0-9\-\_]+\.|)?liveleak\.com/view(\?i\=)([a-zA-Z0-9\-\_]*))|((http(v|vh|vhd)?://)?([a-zA-Z0-9\-\_]+\.|)?facebook\.com/video/video.php\?v\=([a-zA-Z0-9\-\_]*))|((http(vp|vhp)?://)?([a-zA-Z0-9\-\_]+\.|)?youtube\.com/(view_play_list|playlist)(\?p\=|/v/|#!v=)([a-zA-Z0-9\-\_])([^<\s]*)))
  4.  
  5. matches as follows:
  6.  
  7. NODE EXPLANATION
  8. ----------------------------------------------------------------------
  9. (?-imsx: group, but do not capture (case-sensitive)
  10. (with ^ and $ matching normally) (with . not
  11. matching \n) (matching whitespace and #
  12. normally):
  13. ----------------------------------------------------------------------
  14. ( group and capture to \1:
  15. ----------------------------------------------------------------------
  16. ( group and capture to \2 (optional
  17. (matching the most amount possible)):
  18. ----------------------------------------------------------------------
  19. http 'http'
  20. ----------------------------------------------------------------------
  21. ( group and capture to \3 (optional
  22. (matching the most amount possible)):
  23. ----------------------------------------------------------------------
  24. v 'v'
  25. ----------------------------------------------------------------------
  26. | OR
  27. ----------------------------------------------------------------------
  28. vh 'vh'
  29. ----------------------------------------------------------------------
  30. | OR
  31. ----------------------------------------------------------------------
  32. vhd 'vhd'
  33. ----------------------------------------------------------------------
  34. )? end of \3 (NOTE: because you are using
  35. a quantifier on this capture, only the
  36. LAST repetition of the captured
  37. pattern will be stored in \3)
  38. ----------------------------------------------------------------------
  39. :// '://'
  40. ----------------------------------------------------------------------
  41. )? end of \2 (NOTE: because you are using a
  42. quantifier on this capture, only the
  43. LAST repetition of the captured pattern
  44. will be stored in \2)
  45. ----------------------------------------------------------------------
  46. ( group and capture to \4 (optional
  47. (matching the most amount possible)):
  48. ----------------------------------------------------------------------
  49. [a-zA-Z0-9\-\_]+ any character of: 'a' to 'z', 'A' to
  50. 'Z', '0' to '9', '\-', '\_' (1 or more
  51. times (matching the most amount
  52. possible))
  53. ----------------------------------------------------------------------
  54. \. '.'
  55. ----------------------------------------------------------------------
  56. | OR
  57. ----------------------------------------------------------------------
  58. )? end of \4 (NOTE: because you are using a
  59. quantifier on this capture, only the
  60. LAST repetition of the captured pattern
  61. will be stored in \4)
  62. ----------------------------------------------------------------------
  63. youtube 'youtube'
  64. ----------------------------------------------------------------------
  65. \. '.'
  66. ----------------------------------------------------------------------
  67. com/watch 'com/watch'
  68. ----------------------------------------------------------------------
  69. ( group and capture to \5:
  70. ----------------------------------------------------------------------
  71. \? '?'
  72. ----------------------------------------------------------------------
  73. v 'v'
  74. ----------------------------------------------------------------------
  75. \= '='
  76. ----------------------------------------------------------------------
  77. | OR
  78. ----------------------------------------------------------------------
  79. /v/ '/v/'
  80. ----------------------------------------------------------------------
  81. | OR
  82. ----------------------------------------------------------------------
  83. #!v= '#!v='
  84. ----------------------------------------------------------------------
  85. ) end of \5
  86. ----------------------------------------------------------------------
  87. ( group and capture to \6:
  88. ----------------------------------------------------------------------
  89. [a-zA-Z0-9\- any character of: 'a' to 'z', 'A' to
  90. \_]{11} 'Z', '0' to '9', '\-', '\_' (11 times)
  91. ----------------------------------------------------------------------
  92. ) end of \6
  93. ----------------------------------------------------------------------
  94. ( group and capture to \7:
  95. ----------------------------------------------------------------------
  96. [^<\s]* any character except: '<', whitespace
  97. (\n, \r, \t, \f, and " ") (0 or more
  98. times (matching the most amount
  99. possible))
  100. ----------------------------------------------------------------------
  101. ) end of \7
  102. ----------------------------------------------------------------------
  103. ) end of \1
  104. ----------------------------------------------------------------------
  105. | OR
  106. ----------------------------------------------------------------------
  107. ( group and capture to \8:
  108. ----------------------------------------------------------------------
  109. ( group and capture to \9 (optional
  110. (matching the most amount possible)):
  111. ----------------------------------------------------------------------
  112. http 'http'
  113. ----------------------------------------------------------------------
  114. ( group and capture to \10 (optional
  115. (matching the most amount possible)):
  116. ----------------------------------------------------------------------
  117. v 'v'
  118. ----------------------------------------------------------------------
  119. | OR
  120. ----------------------------------------------------------------------
  121. vh 'vh'
  122. ----------------------------------------------------------------------
  123. | OR
  124. ----------------------------------------------------------------------
  125. vhd 'vhd'
  126. ----------------------------------------------------------------------
  127. )? end of \10 (NOTE: because you are
  128. using a quantifier on this capture,
  129. only the LAST repetition of the
  130. captured pattern will be stored in
  131. \10)
  132. ----------------------------------------------------------------------
  133. :// '://'
  134. ----------------------------------------------------------------------
  135. )? end of \9 (NOTE: because you are using a
  136. quantifier on this capture, only the
  137. LAST repetition of the captured pattern
  138. will be stored in \9)
  139. ----------------------------------------------------------------------
  140. ( group and capture to \11 (optional
  141. (matching the most amount possible)):
  142. ----------------------------------------------------------------------
  143. [a-zA-Z0-9\-\_]+ any character of: 'a' to 'z', 'A' to
  144. 'Z', '0' to '9', '\-', '\_' (1 or more
  145. times (matching the most amount
  146. possible))
  147. ----------------------------------------------------------------------
  148. \. '.'
  149. ----------------------------------------------------------------------
  150. | OR
  151. ----------------------------------------------------------------------
  152. )? end of \11 (NOTE: because you are using
  153. a quantifier on this capture, only the
  154. LAST repetition of the captured pattern
  155. will be stored in \11)
  156. ----------------------------------------------------------------------
  157. youtu 'youtu'
  158. ----------------------------------------------------------------------
  159. \. '.'
  160. ----------------------------------------------------------------------
  161. be/ 'be/'
  162. ----------------------------------------------------------------------
  163. ( group and capture to \12:
  164. ----------------------------------------------------------------------
  165. [a-zA-Z0-9\- any character of: 'a' to 'z', 'A' to
  166. \_]{11} 'Z', '0' to '9', '\-', '\_' (11 times)
  167. ----------------------------------------------------------------------
  168. ) end of \12
  169. ----------------------------------------------------------------------
  170. ) end of \8
  171. ----------------------------------------------------------------------
  172. | OR
  173. ----------------------------------------------------------------------
  174. ( group and capture to \13:
  175. ----------------------------------------------------------------------
  176. ( group and capture to \14 (optional
  177. (matching the most amount possible)):
  178. ----------------------------------------------------------------------
  179. http 'http'
  180. ----------------------------------------------------------------------
  181. ( group and capture to \15 (optional
  182. (matching the most amount possible)):
  183. ----------------------------------------------------------------------
  184. v 'v'
  185. ----------------------------------------------------------------------
  186. | OR
  187. ----------------------------------------------------------------------
  188. vh 'vh'
  189. ----------------------------------------------------------------------
  190. | OR
  191. ----------------------------------------------------------------------
  192. vhd 'vhd'
  193. ----------------------------------------------------------------------
  194. )? end of \15 (NOTE: because you are
  195. using a quantifier on this capture,
  196. only the LAST repetition of the
  197. captured pattern will be stored in
  198. \15)
  199. ----------------------------------------------------------------------
  200. :// '://'
  201. ----------------------------------------------------------------------
  202. )? end of \14 (NOTE: because you are using
  203. a quantifier on this capture, only the
  204. LAST repetition of the captured pattern
  205. will be stored in \14)
  206. ----------------------------------------------------------------------
  207. ( group and capture to \16 (optional
  208. (matching the most amount possible)):
  209. ----------------------------------------------------------------------
  210. [a-zA-Z0-9\-\_]+ any character of: 'a' to 'z', 'A' to
  211. 'Z', '0' to '9', '\-', '\_' (1 or more
  212. times (matching the most amount
  213. possible))
  214. ----------------------------------------------------------------------
  215. \. '.'
  216. ----------------------------------------------------------------------
  217. | OR
  218. ----------------------------------------------------------------------
  219. )? end of \16 (NOTE: because you are using
  220. a quantifier on this capture, only the
  221. LAST repetition of the captured pattern
  222. will be stored in \16)
  223. ----------------------------------------------------------------------
  224. metacafe 'metacafe'
  225. ----------------------------------------------------------------------
  226. \. '.'
  227. ----------------------------------------------------------------------
  228. com/watch/ 'com/watch/'
  229. ----------------------------------------------------------------------
  230. ( group and capture to \17:
  231. ----------------------------------------------------------------------
  232. [a-zA-Z0-9\- any character of: 'a' to 'z', 'A' to
  233. \_]{7} 'Z', '0' to '9', '\-', '\_' (7 times)
  234. ----------------------------------------------------------------------
  235. ) end of \17
  236. ----------------------------------------------------------------------
  237. / '/'
  238. ----------------------------------------------------------------------
  239. ( group and capture to \18:
  240. ----------------------------------------------------------------------
  241. [^<^/\s]* any character except: '<', '^', '/',
  242. whitespace (\n, \r, \t, \f, and " ")
  243. (0 or more times (matching the most
  244. amount possible))
  245. ----------------------------------------------------------------------
  246. ) end of \18
  247. ----------------------------------------------------------------------
  248. ( group and capture to \19 (optional
  249. (matching the most amount possible)):
  250. ----------------------------------------------------------------------
  251. [/] any character of: '/'
  252. ----------------------------------------------------------------------
  253. )? end of \19 (NOTE: because you are using
  254. a quantifier on this capture, only the
  255. LAST repetition of the captured pattern
  256. will be stored in \19)
  257. ----------------------------------------------------------------------
  258. ) end of \13
  259. ----------------------------------------------------------------------
  260. | OR
  261. ----------------------------------------------------------------------
  262. ( group and capture to \20:
  263. ----------------------------------------------------------------------
  264. ( group and capture to \21 (optional
  265. (matching the most amount possible)):
  266. ----------------------------------------------------------------------
  267. http 'http'
  268. ----------------------------------------------------------------------
  269. ( group and capture to \22 (optional
  270. (matching the most amount possible)):
  271. ----------------------------------------------------------------------
  272. v 'v'
  273. ----------------------------------------------------------------------
  274. | OR
  275. ----------------------------------------------------------------------
  276. vh 'vh'
  277. ----------------------------------------------------------------------
  278. | OR
  279. ----------------------------------------------------------------------
  280. vhd 'vhd'
  281. ----------------------------------------------------------------------
  282. )? end of \22 (NOTE: because you are
  283. using a quantifier on this capture,
  284. only the LAST repetition of the
  285. captured pattern will be stored in
  286. \22)
  287. ----------------------------------------------------------------------
  288. :// '://'
  289. ----------------------------------------------------------------------
  290. )? end of \21 (NOTE: because you are using
  291. a quantifier on this capture, only the
  292. LAST repetition of the captured pattern
  293. will be stored in \21)
  294. ----------------------------------------------------------------------
  295. ( group and capture to \23 (optional
  296. (matching the most amount possible)):
  297. ----------------------------------------------------------------------
  298. [a-zA-Z0-9\-\_]+ any character of: 'a' to 'z', 'A' to
  299. 'Z', '0' to '9', '\-', '\_' (1 or more
  300. times (matching the most amount
  301. possible))
  302. ----------------------------------------------------------------------
  303. \. '.'
  304. ----------------------------------------------------------------------
  305. | OR
  306. ----------------------------------------------------------------------
  307. )? end of \23 (NOTE: because you are using
  308. a quantifier on this capture, only the
  309. LAST repetition of the captured pattern
  310. will be stored in \23)
  311. ----------------------------------------------------------------------
  312. vimeo 'vimeo'
  313. ----------------------------------------------------------------------
  314. \. '.'
  315. ----------------------------------------------------------------------
  316. com/ 'com/'
  317. ----------------------------------------------------------------------
  318. ( group and capture to \24:
  319. ----------------------------------------------------------------------
  320. [a-zA-Z0-9\- any character of: 'a' to 'z', 'A' to
  321. \_]{8} 'Z', '0' to '9', '\-', '\_' (8 times)
  322. ----------------------------------------------------------------------
  323. ) end of \24
  324. ----------------------------------------------------------------------
  325. ( group and capture to \25 (optional
  326. (matching the most amount possible)):
  327. ----------------------------------------------------------------------
  328. [/] any character of: '/'
  329. ----------------------------------------------------------------------
  330. )? end of \25 (NOTE: because you are using
  331. a quantifier on this capture, only the
  332. LAST repetition of the captured pattern
  333. will be stored in \25)
  334. ----------------------------------------------------------------------
  335. ) end of \20
  336. ----------------------------------------------------------------------
  337. | OR
  338. ----------------------------------------------------------------------
  339. ( group and capture to \26:
  340. ----------------------------------------------------------------------
  341. ( group and capture to \27 (optional
  342. (matching the most amount possible)):
  343. ----------------------------------------------------------------------
  344. http 'http'
  345. ----------------------------------------------------------------------
  346. ( group and capture to \28 (optional
  347. (matching the most amount possible)):
  348. ----------------------------------------------------------------------
  349. v 'v'
  350. ----------------------------------------------------------------------
  351. | OR
  352. ----------------------------------------------------------------------
  353. vh 'vh'
  354. ----------------------------------------------------------------------
  355. | OR
  356. ----------------------------------------------------------------------
  357. vhd 'vhd'
  358. ----------------------------------------------------------------------
  359. )? end of \28 (NOTE: because you are
  360. using a quantifier on this capture,
  361. only the LAST repetition of the
  362. captured pattern will be stored in
  363. \28)
  364. ----------------------------------------------------------------------
  365. :// '://'
  366. ----------------------------------------------------------------------
  367. )? end of \27 (NOTE: because you are using
  368. a quantifier on this capture, only the
  369. LAST repetition of the captured pattern
  370. will be stored in \27)
  371. ----------------------------------------------------------------------
  372. ( group and capture to \29 (optional
  373. (matching the most amount possible)):
  374. ----------------------------------------------------------------------
  375. [a-zA-Z0-9\-\_]+ any character of: 'a' to 'z', 'A' to
  376. 'Z', '0' to '9', '\-', '\_' (1 or more
  377. times (matching the most amount
  378. possible))
  379. ----------------------------------------------------------------------
  380. \. '.'
  381. ----------------------------------------------------------------------
  382. | OR
  383. ----------------------------------------------------------------------
  384. )? end of \29 (NOTE: because you are using
  385. a quantifier on this capture, only the
  386. LAST repetition of the captured pattern
  387. will be stored in \29)
  388. ----------------------------------------------------------------------
  389. liveleak 'liveleak'
  390. ----------------------------------------------------------------------
  391. \. '.'
  392. ----------------------------------------------------------------------
  393. com/view 'com/view'
  394. ----------------------------------------------------------------------
  395. ( group and capture to \30:
  396. ----------------------------------------------------------------------
  397. \? '?'
  398. ----------------------------------------------------------------------
  399. i 'i'
  400. ----------------------------------------------------------------------
  401. \= '='
  402. ----------------------------------------------------------------------
  403. ) end of \30
  404. ----------------------------------------------------------------------
  405. ( group and capture to \31:
  406. ----------------------------------------------------------------------
  407. [a-zA-Z0-9\-\_]* any character of: 'a' to 'z', 'A' to
  408. 'Z', '0' to '9', '\-', '\_' (0 or more
  409. times (matching the most amount
  410. possible))
  411. ----------------------------------------------------------------------
  412. ) end of \31
  413. ----------------------------------------------------------------------
  414. ) end of \26
  415. ----------------------------------------------------------------------
  416. | OR
  417. ----------------------------------------------------------------------
  418. ( group and capture to \32:
  419. ----------------------------------------------------------------------
  420. ( group and capture to \33 (optional
  421. (matching the most amount possible)):
  422. ----------------------------------------------------------------------
  423. http 'http'
  424. ----------------------------------------------------------------------
  425. ( group and capture to \34 (optional
  426. (matching the most amount possible)):
  427. ----------------------------------------------------------------------
  428. v 'v'
  429. ----------------------------------------------------------------------
  430. | OR
  431. ----------------------------------------------------------------------
  432. vh 'vh'
  433. ----------------------------------------------------------------------
  434. | OR
  435. ----------------------------------------------------------------------
  436. vhd 'vhd'
  437. ----------------------------------------------------------------------
  438. )? end of \34 (NOTE: because you are
  439. using a quantifier on this capture,
  440. only the LAST repetition of the
  441. captured pattern will be stored in
  442. \34)
  443. ----------------------------------------------------------------------
  444. :// '://'
  445. ----------------------------------------------------------------------
  446. )? end of \33 (NOTE: because you are using
  447. a quantifier on this capture, only the
  448. LAST repetition of the captured pattern
  449. will be stored in \33)
  450. ----------------------------------------------------------------------
  451. ( group and capture to \35 (optional
  452. (matching the most amount possible)):
  453. ----------------------------------------------------------------------
  454. [a-zA-Z0-9\-\_]+ any character of: 'a' to 'z', 'A' to
  455. 'Z', '0' to '9', '\-', '\_' (1 or more
  456. times (matching the most amount
  457. possible))
  458. ----------------------------------------------------------------------
  459. \. '.'
  460. ----------------------------------------------------------------------
  461. | OR
  462. ----------------------------------------------------------------------
  463. )? end of \35 (NOTE: because you are using
  464. a quantifier on this capture, only the
  465. LAST repetition of the captured pattern
  466. will be stored in \35)
  467. ----------------------------------------------------------------------
  468. facebook 'facebook'
  469. ----------------------------------------------------------------------
  470. \. '.'
  471. ----------------------------------------------------------------------
  472. com/video/video 'com/video/video'
  473. ----------------------------------------------------------------------
  474. . any character except \n
  475. ----------------------------------------------------------------------
  476. php 'php'
  477. ----------------------------------------------------------------------
  478. \? '?'
  479. ----------------------------------------------------------------------
  480. v 'v'
  481. ----------------------------------------------------------------------
  482. \= '='
  483. ----------------------------------------------------------------------
  484. ( group and capture to \36:
  485. ----------------------------------------------------------------------
  486. [a-zA-Z0-9\-\_]* any character of: 'a' to 'z', 'A' to
  487. 'Z', '0' to '9', '\-', '\_' (0 or more
  488. times (matching the most amount
  489. possible))
  490. ----------------------------------------------------------------------
  491. ) end of \36
  492. ----------------------------------------------------------------------
  493. ) end of \32
  494. ----------------------------------------------------------------------
  495. | OR
  496. ----------------------------------------------------------------------
  497. ( group and capture to \37:
  498. ----------------------------------------------------------------------
  499. ( group and capture to \38 (optional
  500. (matching the most amount possible)):
  501. ----------------------------------------------------------------------
  502. http 'http'
  503. ----------------------------------------------------------------------
  504. ( group and capture to \39 (optional
  505. (matching the most amount possible)):
  506. ----------------------------------------------------------------------
  507. vp 'vp'
  508. ----------------------------------------------------------------------
  509. | OR
  510. ----------------------------------------------------------------------
  511. vhp 'vhp'
  512. ----------------------------------------------------------------------
  513. )? end of \39 (NOTE: because you are
  514. using a quantifier on this capture,
  515. only the LAST repetition of the
  516. captured pattern will be stored in
  517. \39)
  518. ----------------------------------------------------------------------
  519. :// '://'
  520. ----------------------------------------------------------------------
  521. )? end of \38 (NOTE: because you are using
  522. a quantifier on this capture, only the
  523. LAST repetition of the captured pattern
  524. will be stored in \38)
  525. ----------------------------------------------------------------------
  526. ( group and capture to \40 (optional
  527. (matching the most amount possible)):
  528. ----------------------------------------------------------------------
  529. [a-zA-Z0-9\-\_]+ any character of: 'a' to 'z', 'A' to
  530. 'Z', '0' to '9', '\-', '\_' (1 or more
  531. times (matching the most amount
  532. possible))
  533. ----------------------------------------------------------------------
  534. \. '.'
  535. ----------------------------------------------------------------------
  536. | OR
  537. ----------------------------------------------------------------------
  538. )? end of \40 (NOTE: because you are using
  539. a quantifier on this capture, only the
  540. LAST repetition of the captured pattern
  541. will be stored in \40)
  542. ----------------------------------------------------------------------
  543. youtube 'youtube'
  544. ----------------------------------------------------------------------
  545. \. '.'
  546. ----------------------------------------------------------------------
  547. com/ 'com/'
  548. ----------------------------------------------------------------------
  549. ( group and capture to \41:
  550. ----------------------------------------------------------------------
  551. view_play_list 'view_play_list'
  552. ----------------------------------------------------------------------
  553. | OR
  554. ----------------------------------------------------------------------
  555. playlist 'playlist'
  556. ----------------------------------------------------------------------
  557. ) end of \41
  558. ----------------------------------------------------------------------
  559. ( group and capture to \42:
  560. ----------------------------------------------------------------------
  561. \? '?'
  562. ----------------------------------------------------------------------
  563. p 'p'
  564. ----------------------------------------------------------------------
  565. \= '='
  566. ----------------------------------------------------------------------
  567. | OR
  568. ----------------------------------------------------------------------
  569. /v/ '/v/'
  570. ----------------------------------------------------------------------
  571. | OR
  572. ----------------------------------------------------------------------
  573. #!v= '#!v='
  574. ----------------------------------------------------------------------
  575. ) end of \42
  576. ----------------------------------------------------------------------
  577. ( group and capture to \43:
  578. ----------------------------------------------------------------------
  579. [a-zA-Z0-9\-\_] any character of: 'a' to 'z', 'A' to
  580. 'Z', '0' to '9', '\-', '\_'
  581. ----------------------------------------------------------------------
  582. ) end of \43
  583. ----------------------------------------------------------------------
  584. ( group and capture to \44:
  585. ----------------------------------------------------------------------
  586. [^<\s]* any character except: '<', whitespace
  587. (\n, \r, \t, \f, and " ") (0 or more
  588. times (matching the most amount
  589. possible))
  590. ----------------------------------------------------------------------
  591. ) end of \44
  592. ----------------------------------------------------------------------
  593. ) end of \37
  594. ----------------------------------------------------------------------
  595. ) end of grouping
  596. ----------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement