working on it ...

Filters

Explore Public Snippets

Sort by

Found 4 snippets

    public by viveklucky1848  2450  2  6  0

    Life-saver regex to remove desired html tags completely with their contents

    Remove html tags with their contents, useful when you want to remove certain frequently occurring tags from page, for designer to set design with css. (eg. label tag)
    Find: <label.*?>(.|\s)*?</label>
    Replace with: ''(nothing :) not even quotes)
    
    
    Dare to try below example with my devilish remover;)
    
    <label class="email" for="email">
    	<span>New Email</span>
    	<p>New email 2</p>
    	NEW EMAIL3
    </label>                                    

    public by viveklucky1848  1973  0  6  1

    Replace multiple whitespaces with single character linewise

    Replace multiple whitespaces with single character(eg. |) in each line:
    Find: [ \t]+ or [ \t]{2,}
    Replace with: |

    external by helloris25  150  0  2  0

    RegExp YouTube video iFrame | object

    RegExp YouTube video iFrame | object: RegExp YouTube video iFrame | object
    $regexstr = '~
    # Match Youtube link and embed code
    (?:				 # Group to match embed codes
       (?:<iframe [^>]*src=")?	 # If iframe match up to first quote of src
       |(?:				 # Group to match if older embed
          (?:<object .*>)?		 # Match opening Object tag
          (?:<param .*</param>)*     # Match all param tags
          (?:<embed [^>]*src=")?     # Match embed tag to the first quote of src
       )?				 # End older embed code group
    )?				 # End embed code groups
    (?:				 # Group youtube url
       https?:\/\/		         # Either http or https
       (?:[\w]+\.)*		         # Optional subdomains
       (?:               	         # Group host alternatives.
           youtu\.be/      	         # Either youtu.be,
           | youtube\.com		 # or youtube.com 
           | youtube-nocookie\.com	 # or youtube-nocookie.com
       )				 # End Host Group
       (?:\S*[^\w\-\s])?       	 # Extra stuff up to VIDEO_ID
       ([\w\-]{11})		         # $1: VIDEO_ID is numeric
       [^\s]*			 # Not a space
    )				 # End group
    "?				 # Match end quote if part of src
    (?:[^>]*>)?			 # Match any extra stuff up to close brace
    (?:				 # Group to match last embed code
       </iframe>		         # Match the end of the iframe	
       |</embed></object>	         # or Match the end of the older embed
    )?				 # End Group of last bit of embed code
    ~ix';
    
    

    external by marcel-jahn  34  0  1  0

    RegExp: find Urls

    RegExp: find Urls: RegExp: find Urls
    /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/g
    
    

    List Complete ( 4 snippets total )

    • Public Snippets
    • Channels Snippets