Welcome To Snipplr
Everyone's Recent Regular Expression Snippets Tagged php
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
« Prev 1 Next »
search for anything in-between two <TAG>'s and then replace the found string into the PHP if/else staement. $1 is wher TextMate stores the found string. (see http://screenflicker.com/mike/code/textmate-regex-replace/)
3
887
posted 13 years ago by rwczippy
PCRE that matches any kind of YouTube URL and catches its video ID. It supports three kinds of URL: the classic (?v=), the AJAXed one (#!v=) and the short version (youtu.be). It also supports international URLs.
Tested with Javascript and PHP.
1
1339
posted 13 years ago by nkm
Use this to quickly clean-up a file which has opening braces on a new line, a particular annoyance of mine.
1
615
posted 14 years ago by Zenithus
« Prev 1 Next »