# e2pdf/1.08.06/classes/helper/e2pdf-shortcode.php

E2Pdf – Export Pdf Tool for WordPress, version 1.08.06. 62 lines.

- Page: https://pluginprobe.com/plugins/e2pdf/1.08.06/code/classes/helper/e2pdf-shortcode.php
- Raw: https://pluginprobe.com/plugins/e2pdf/1.08.06/raw/classes/helper/e2pdf-shortcode.php
- Modified: 2019-07-26T18:15:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/e2pdf/1.08.06/code/classes/helper/e2pdf-shortcode.php#L10-L20`.

```php
<?php

/**
 * E2pdf Shortcode Helper
 * 
 * @copyright  Copyright 2017 https://e2pdf.com
 * @license    GPL v2
 * @version    1
 * @link       https://e2pdf.com
 * @since      1.07.02
 */
if (!defined('ABSPATH')) {
    die('Access denied.');
}

class Helper_E2pdf_Shortcode {

    public function get_shortcode_regex($tagnames = null) {
        if (version_compare(get_bloginfo('version'), '4.4.0', '<')) {
            global $shortcode_tags;

            if (empty($tagnames)) {
                $tagnames = array_keys($shortcode_tags);
            }
            $tagregexp = join('|', array_map('preg_quote', $tagnames));

            return
                    '\\['
                    . '(\\[?)'
                    . "($tagregexp)"
                    . '(?![\\w-])'
                    . '('
                    . '[^\\]\\/]*'
                    . '(?:'
                    . '\\/(?!\\])'
                    . '[^\\]\\/]*'
                    . ')*?'
                    . ')'
                    . '(?:'
                    . '(\\/)'
                    . '\\]'
                    . '|'
                    . '\\]'
                    . '(?:'
                    . '('
                    . '[^\\[]*+'
                    . '(?:'
                    . '\\[(?!\\/\\2\\])'
                    . '[^\\[]*+'
                    . ')*+'
                    . ')'
                    . '\\[\\/\\2\\]'
                    . ')?'
                    . ')'
                    . '(\\]?)';
        } else {
            return get_shortcode_regex($tagnames);
        }
    }

}

```
