Skip to main content

Timeline for Match groups in regular expressions

Current License: CC BY-SA 3.0

4 events
when toggle format what by license comment
Jun 5, 2015 at 13:50 comment added Mr.Wizard @alessandro That is because of the right hand side of the Rule; if you use RegularExpression["(.*) .* (.*)"] -> foo["$1", "$2"] you will see foo instead. If you want a flat list you could use RegularExpression["(.*) .* (.*)"] -> Sequence["$1", "$2"] or Flatten @ StringCases[ . . . ].
Jun 5, 2015 at 8:37 comment added alessandro perfectly, thanks! I'm just surprised it doesnt return {"big", "wolf"}: why is it one level deeper?
Jun 5, 2015 at 8:36 vote accept alessandro
Jun 4, 2015 at 13:29 history answered m_goldberg CC BY-SA 3.0