Skip to content

Instantly share code, notes, and snippets.

@Xiradorn
Last active August 29, 2015 14:23
Show Gist options
  • Save Xiradorn/af78a62bce34c5ba49d9 to your computer and use it in GitHub Desktop.
Save Xiradorn/af78a62bce34c5ba49d9 to your computer and use it in GitHub Desktop.
RegEx functions
<?php
/* X-Meta Img Auto Recog */
$xir_meta_img = '/(?<xir_img_link>(?:<img (?(?=id)(?<xir_id>id="xir_(?:.*?)")) src="(?<xir_src>(?:(?:(?:http:|https:|)\/\/).*?)(?:\.jpg|\.jpeg|\.png|\.svg|\.gif))" \/>))/';
/* X-Meta Img Auto Recog - Powered */
$xir_meta_img_nospecial = '/(?<xir_img_link>(?:<img (?(?=id)(?<xir_id>id="xir_(?:.*?)")) src="(?<xir_src>(?:(?:(?:http:|https:|)(?:\/\/)(?:[a-zA-Z0-9\.\-\/\%\_\~]+)))(?:\.jpg|\.jpeg|\.png|\.svg|\.gif))" \/>))/';
/* X-Phpbb Seo Auto Recog */
$phpbb_seo_link = '/(?<link>(?:https:|http:)(?:\/\/)(?:[a-zA-Z0-9\.\-\/\%\_\~]+)(?:\.html)(?(?=\#)(?:[\#p]{2}[0-9]+)))/';
/* X-Beautify Link Recog */
$phpbb_seo_shorter_link = '/(?<link>(?:https:|http:)(?:\/\/'.str_replace('/','\/',$forum_path).'/)(?<linkpart>[a-zA-Z0-9\.\-\/\%\_\~]+)(?<ext>\.html))(?(?=\#)(?:[\#p]{2}[0-9]+))/';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment