Jump to content
Sign in to follow this  
EcoReality

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...