Skip to content

Instantly share code, notes, and snippets.

@crazyyy
Last active February 1, 2022 13:21
Show Gist options
  • Save crazyyy/baee46c02259f7bc895861899cce7f85 to your computer and use it in GitHub Desktop.
Save crazyyy/baee46c02259f7bc895861899cce7f85 to your computer and use it in GitHub Desktop.
#regexp || examples

Regex

Find and remove vendor prefixes in your CSS using Regex

\-(moz|o|webkit|ms|khtml)\-(?!font-smoothing|osx|print|backface).+?;
style\s*=\s*?("((""|\\"|[^"<>])*?)"|'((''|\\'|[^'<>])*?)'|[^\s"'>]*?)
$string = preg_replace('/<div id=\"myid\">.*<\/div>/','anything',$string);
$search = '/<link .*\/>/';
$response = preg_replace($search,'', $response);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment