Welcome To Snipplr


Everyone's Recent Snippets Tagged regex



0 42 posted 9 years ago by metoikos
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 69 posted 9 years ago by rwczippy
This code separates out the Flash Player Platform, Major Version number and Minor Version numbers.
0 50 posted 9 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 80 posted 10 years ago by blackf0rk
0 31 posted 10 years ago by aviddv1
this function return associative array from SERVER_SOFTWARE
1 70 posted 10 years ago by naz
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 67 posted 10 years ago by adrianparr
This is a snippet to validate anagrams of 'debit card'. It validates 'debit card' and 'bad credit'
0 36 posted 10 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 122 posted 10 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 45 posted 10 years ago by abbey
regular expression that removes or replaces input text
0 39 posted 10 years ago by vagrantradio
Grant Skinner's RegExr: Online Regular Expression Testing Tool is very handy for checking your regular expressions. http://www.gskinner.com/RegExr/
0 120 posted 10 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 76 posted 10 years ago by softmechanics
Howto search and replace in vim when editing a file.
1 46 posted 10 years ago by wdso
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 340 posted 10 years ago by world_eggplant
Scans a file for a series of floating point numbers separated by spaces.
0 50 posted 10 years ago by vorp
0 36 posted 10 years ago by berkes
testing tool: http://www.pythonregex.com/
0 120 posted 10 years ago by backlashblues