Kobi , , .
, , :
str = "My name is #{first_name} #{last_name}"
... : str = "My name is #{first_name}
. :
/^[\t ]*([^#"'\r\n]("(\\"|[^"])*"|'(\\'|[^'])*'|[^#\n\r])*)(#([^#\r\n]*))?/
^[\t ]* - .([^#"'\r\n]("(\\"|[^"])*"|'(\\'|[^'])*'|[^#\n\r])*) - . :[^#"'\r\n] - ..."(\\"|[^"])*" - ...'(\\'|[^'])*' - ...[^#\n\r] - , # .
(#([^#\r\n]*))? - , .
- 6 . Subpattern 1 - , 6 - , .
:
1 + 1
user = User.new
user.name = "Ryan #{last_name}"
( 2, 3, 4, 5):
1. 1 + 1
6. Simple math (this comment would be collected)
1. user = User.new
6.
1. user.name = "Ryan #{last_name}"
6. Setting an attribute
: http://rubular.com/r/yKxEazjNPC