Welcome To Snipplr


Everyone's Recent Snippets Tagged regex



1 2 3 4 5 ... 8
1 1259 posted 14 years ago by metoikos
Matches text between each pair of asterisks (see URL above for demo) **Example:** Make text between asterisks bold, like in Textile (in Ruby): `test.gsub(/(\*)+([^.*?$]+)+(\*)/, '<strong>\\2</strong>')`
0 3917 posted 14 years ago by inko9nito
These five characters should be replaced with their HTML entity names before being used in XML, otherwise they may cause the XML to be invalid.
0 1900 posted 15 years ago by adrianparr
This snippet replaces all three different version strings in file `verid.h` using regular expressions with the value of properties `$(Major)`, `%(Minor)`, `$(SP)` and `$(Build)` when the property `$(Label)` has value _true_. To run this project you...
0 1895 posted 15 years ago by cappellin
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 1615 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 1196 posted 15 years ago by jarnaldich
it parses given string and returns 1st number it encounters ( it will replace comas with dots so floats formatted as 12,345 could be 12.345 ( some countries use that ) ) then u can parse returned value as a number / float / int - do what You need...
0 1487 posted 15 years ago by stryju
This regular expression used in Ruby will extract the characters between single or multi-character delimiters. It helps when you have strange delimiters such as \":delimeter1: text I want to grab goes here :delimiter2:\"
0 1560 posted 15 years ago by webonomic
I\'m trying to find an expression to match a whole sentence. So really the pattern is the regex of the subject.
1 3595 posted 15 years ago by thefrosty
0 2627 posted 15 years ago by peceps
Youtube ID simple extractor
1 1300 posted 15 years ago by jhonqwerty
useful in conjunction with curl and examining headers
0 1444 posted 15 years ago by thiswayup
As an example – will find and replace all `<b>` elements with `<strong>`
0 4001 posted 15 years ago by jayphen
check the original blogpost for more how-to examples
0 1605 posted 15 years ago by magicrebirth
Use this regex search in Dreamweaver's find/replace to remove any html tag attributes
1 5018 posted 15 years ago by bjornredemption
0 1375 posted 15 years ago by traeregan
Remove breaklines / html formatting
2 1560 posted 15 years ago by derekholmes
A very liberal validation of phone number. Assures there are at least 10 digits in there somewhere.
1 1241 posted 15 years ago by housecor
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 1700 posted 15 years ago by adrianparr
I\'ve added an additional case to handle videos linked from a user\'s channel.
2 2387 posted 15 years ago by Jamie
0 1393 posted 15 years ago by krlogin11
2 1149 posted 15 years ago by dalcacer
A source to help you interpreting URLs in plain text as a HTML link. It's an improvement of what was proposed here : http://snipplr.com/view/2371/regex-regular-expression-to-match-a-url/
3 2272 posted 15 years ago by keevkilla
1 2 3 4 5 ... 8