Welcome To Snipplr


Everyone's Recent Snippets Tagged regex



0 855 posted 14 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 1113 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
0 671 posted 14 years ago by aviddv1
this function return associative array from SERVER_SOFTWARE
1 938 posted 14 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 1003 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
regular expression that removes or replaces input text
0 755 posted 14 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 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
0 864 posted 14 years ago by magicrebirth
Howto search and replace in vim when editing a file.
1 801 posted 14 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 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
0 766 posted 14 years ago by berkes
testing tool: http://www.pythonregex.com/
0 1406 posted 14 years ago by backlashblues