Skip to content

Instantly share code, notes, and snippets.

@SavannahF
SavannahF / gist:61b12a2c880183e1612488f8ec8b4aa3
Last active November 12, 2022 13:55
Tutorial for Regex Matching a URL

Tutorial for a Regex Matching a URL

A regular expression, or regex, is a sequence of characters that defines a search pattern that can be used to validate user input. This tutorial breaks down a regex used for matching a URL.

Summary

The following regex can be used to validate a URL and has been broken down in this tutorial by its components (anchor, quantifies, grouping constructs, bracket expressions, character classes, and character escapes). Each section describes the symbol, a description, and where the code is found within the regex.

Regex Matching a URL:
@dazecoop
dazecoop / attributes-as-options.php
Last active August 30, 2024 15:32
WooCommerce product attributes as selectable options without variations
<?php
/**
* List available attributes on product page in a drop-down selection
*/
add_action('woocommerce_before_add_to_cart_button', 'list_attributes_on_product_page');
function list_attributes_on_product_page() {
global $product;
$attributes = $product->get_attributes();
@heiswayi
heiswayi / google-dorks-2015.txt
Created October 26, 2015 07:14
Google Dorks List 2015
intitle:index.of .bash_history
intitle:index.of .sh_history
intitle:"Index of" index.html.bak
intitle:"Index of" index.php.bak
intitle:"Index of" index.jsp.bak
intitle:"Index of" ".htpasswd" htpasswd.bak
inurl:backup intitle:index.of inurl:admin
"Index of /backup"
intitle:"Index of" index.html~
intitle:"Index of" index.php~