[\p{IsCyrillic}]+,[а-яА-ЯёЁ]+- Cyrillic words^[\s\t]+?(font|background|border|link|vlink|color)(-\w+)?:.*$- CSS property lines
Last active
October 24, 2025 13:50
-
-
Save iegik/5582637 to your computer and use it in GitHub Desktop.
Collection of Regular Expressions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * @description remove background images, fonts, colors and border styles | |
| */ | |
| function (){ | |
| return /(^[\s\t]+?(font|background|border|link|vlink|color)(-\w+)?:.*$)/gim; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Applys class .hover to :hover states in CSS file, and for :focus state too (Bootstrap): | |
| sed 's/([^},]+)\:(hover)([^,]*)/$1:$2$3,$1.$2$3/gim;s/([^},]+)\:(focus)([^,]*)/$1:$2$3,$1.$2$3/gim' $1 | |
| # Light version: | |
| sed 's/\:focus/.focus/gim;s/\:hover/.hover/gim' | |
| # Remove BOM | |
| sed -e '1s/^\xef\xbb\xbf//' filename |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // PCRE | |
| // validation: | |
| $validation = array( | |
| '' => "/^[A-Fa-f0-9]{32}/", // HEX(32) | |
| '' => '/^\w+/', // Word | |
| '' => "/^\d+(\.\d+)/", // Float | |
| '' => "/^\d+{11}$/", // Integer(11) | |
| '' => '/^(([\x22\x21])[a-zA-Z\x20-\x3f\x5b-\x60\x7b]+(\2)|[a-zA-Z\x20\x23-\x3f\x5b-\x60\x7b]){1,64}@(([a-z0-9\-]{1,63}\.?){0,255}|([0-9]{1,3}\.?){4})/', // Email (\b|^)(([\x22\x21])[a-zA-Z\x20-\x3f\x5b-\x60\x7b]+(\2)|[a-zA-Z\x20\x23-\x3f\x5b-\x60\x7b]){1,64}@(([a-z0-9\-]{1,63}\.?){0,255}|([0-9]{1,3}\.?){4})(\b|$) | |
| // | |
| 'hello' => '/^\w+/', // Word | |
| 'world' => '/^\w+/', // Word | |
| ); | |
| foreach($_GET as $key => $arg){ | |
| if(@$validation[$key] && preg_match($validation[$key], trim($arg)) > 0) { | |
| $$key = trim($arg); | |
| } | |
| } | |
| //mysql_real_escape_string($hello); | |
| ?> | |
| <h1><?php echo $hello?>, <?php echo $world?></h1> | |
| <img src="data:image/png;base64,<?php echo $dataIRI?>"/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment