Welcome To Snipplr
Everyone's Recent Snippets Tagged regexp
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
replace foo -> bar in all .txt files down the tree
Dunno why, the syntax highlighter adds \3's to the code. Try plain text.
0
2330
posted 15 years ago by jarnaldich
Searches down the current directory every file whose name matches (case insensitively) {{file_pattern}} for the regexp {{text}}.
0
1832
posted 15 years ago by jarnaldich
For several reasons, including portability, reducing download size, and general code neatness, I like to make all links within a website root relative.
0
1723
posted 16 years ago by weboholic
ActionScript 3
AS3 Trim a Comma Delimited String (e.g. a list of comma separated keywords entered by a user)
This function trims a string and removes empty entries in a comma delimited list, removes extra commas from the beginning and end and also remove extra space characters between words.
1
2412
posted 16 years ago by adrianparr
This code separates out the Flash Player Platform, Major Version number and Minor Version numbers.
0
2185
posted 16 years ago by adrianparr
simple function to get querystring from a custom address using regular expression
0
1597
posted 16 years ago by mcarneiro
In AS2 forward slashes got url-encoded to %2F when you escaped them. But in AS3 they get ignored and left as they are. In some situations I have found that this can cause problems. So you can do it manually using this regular expression.
0
2236
posted 16 years ago by adrianparr
Very simple to use.
**Calling:**
$files = dirContents(DIR_PATH, [FILTER, [TYPE]]);
**Examples:**
$files = dirContens("my-dir");
_$files_ is array containing all, both files either directories
$files = dirContens("my-dir",...
0
1715
posted 16 years ago by Lostindream
Grant Skinner's RegExr: Online Regular Expression Testing Tool is very handy for checking your regular expressions.
http://www.gskinner.com/RegExr/
0
3150
posted 16 years ago by adrianparr
Functions to make using regular expressions a bit easier. They're named after the respective PHP function.
2
2444
posted 17 years ago by wizard04
This snippet is useful if you want to extract the relevant parts out of an Date header field of an email message. It was created according to the [RFC 5322 rules](http://tools.ietf.org/html/rfc5322#page-15 "RFC 5322, Page 15"). It supports named capt...
1
2450
posted 17 years ago by dreadwarrior
You can get hostname from script environment - getenv("HTTP_HOST")
(?!'.$host.') matches URLs always except local links
0
1885
posted 17 years ago by kossmoss