Jump to content

Regular Expressions for snippets


Recommended Posts

I really like the {clipboard} variable in snippets, but it would be nice to be able to modify the clipboard as part of including it.

 

Regular Expression syntax is pretty heavy, but there are lots of references, and with the simple inclusion of a lib, it should be almost free to implement.

 

But I'd be happy with any reasonably powerful editing scheme. In particular, I like to turn the clipboard into Google search links, but they really should be "HTMLized" so that spaces are changed into plus signs, punctuation is removed, etc.

 

Here is an example: <a href="http://www.lmgtfy.com/?q=Here is an example:">Here is an example:</a> But you really want the search to be "q=Here+is+an+example" (dropped punctuation) or "q=Here+is+an+example%3A" (HTMLized punctuation). With regular expressions, either would be easy to do.

Edited by EcoReality
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...