Match text between asterisks


/ Published in: Regular Expression
Save to your folder(s)

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>')`


Copy this code and paste it in your HTML
  1. (\*)+([^.*?$]+)+(\*)

URL: http://rubular.com/r/73UNIqgDuO

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.