I've got a multiline string like this. Ity has line feeds.
[Site Url="http://medportal.domain.edu" Owner="DOMAIN\user1" SecondaryOwner="DOMAIN\user2" ContentDatabase="WSS_Content_$1" StorageUsedMB="0.8" StorageWarningMB="0" StorageMaxMB="0" /] [Site Url="http://medportal.domain.edu/sites/ahSC" Owner="DOMAIN\user1" ContentDatabase="WSS_Content_ahSC" StorageUsedMB="22.3" StorageWarningMB="0" StorageMaxMB="0" /] [Site Url="http://medportal.domain.edu/sites/ARCTIC" Owner="DOMAIN\user1" ContentDatabase="WSS_Content_ARCTIC" StorageUsedMB="0.1" StorageWarningMB="0" StorageMaxMB="0" /]
I need to extract and format out strings that look like this:
stsadm.exe -o deletecontentdb -url "http://medportal.domain.edu" -databasename "WSS_Content_$1" -databaseserver myfixedservername
Where the two arguments are Url and ContentDatabase.
This pattern almost works but it picks up extra stuff and can't handle multiline
(.)\s(Url=)(?.)\s(.)\s(ContentDatabase=)(?.)\s(StorageUsedMB=)(.*)
replace:
stsadm.exe -o deletecontentdb -url ${url} -databasename ${databasename} -databaseserver myfixedservername
Thank you.