Welcome To Snipplr
Everyone's Recent Snippets Tagged regex
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
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
1114
posted 14 years ago by rwczippy
This code separates out the Flash Player Platform, Major Version number and Minor Version numbers.
0
956
posted 14 years ago by adrianparr
This code will take a start and end string and then search for them within the subject string. It returns what is between the start and end strings. As an example, if I had the following text...
Some test text string, with a start <tag> and an end...
0
991
posted 14 years ago by blackf0rk
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
1004
posted 14 years ago by adrianparr
This is a snippet to validate anagrams of 'debit card'. It validates 'debit card' and 'bad credit'
0
629
posted 14 years ago by mangrar
After a problem with row break in a text field I found this way of searching within a where clause in an SQL query. Can be used for selection or update / replace purposes of course.
0
1344
posted 14 years ago by davidrinnan
Before taking a site "live", I password protect it except the robots.txt for search engines and custom Error pages. You can adapt this to your own use and add other pages in the FilesMatch directive.
0
712
posted 14 years ago by abbey
Grant Skinner's RegExr: Online Regular Expression Testing Tool is very handy for checking your regular expressions.
http://www.gskinner.com/RegExr/
0
1704
posted 14 years ago by adrianparr
HSH is a cool haskell library that allows you to leverage your shell scripting prowess in haskell programs. In this simple broadcatcher, I use curl for http get, and other standard unix tools for tracking history (so we don't get the same file twice...
1
1043
posted 14 years ago by softmechanics
Easily grabs email addresses from a bulk text (CSV and/or some other email address-filled list/db).
Example #2 takes the input (bulk text) from textarea #input and puts the clean emails in the textarea #extractedemails.
1
2951
posted 14 years ago by world_eggplant
Scans a file for a series of floating point numbers separated by spaces.
0
833
posted 14 years ago by vorp