I have a list of String in Scala, each String has a key/value format as follows:
<row Id="25780063" PostTypeId="2" ParentId="25774527" CreationDate="2014-09-11T05:56:29.900" />
Each String may have some extra key/value. I'd like to extract the value for a few keys for each string. Here is the pattern I've defined but it is not working properly
val idPattern = "Id=(.*).r
val typePattern = "PostTypeId=(.*)".r
How can I correctly extract the value for 'Id' and 'PostTypeId'?