initially, i tried this but unfortunately it did not work - got the same error as yours.
"str1" := "value 1",
"str2" := "value 2",
i think it might cause by text editor, so i changed it to this and it worked.
"str1" := "value 1", "str2" := "value 2",
after that, i went to gui and reverted it back (in gui) and it still worked.
"str1" := "value 1",
"str2" := "value 2",
just for reference
iRules Data Group Formatting Rules by Jason
http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/1086448/iRules-Data-Group-Formatting-Rules.aspx