You're missing a separator (which is ~
in your case). It looks like you are trying to put it on the end of $searchString
, which is strange. I don't know why you're doing that. The reason it doesn't work is because the variables don't get expanded inside single-quoted strings.
This might work:
sed -i "s~${searchString}\1${replacementString}~g" $file
Really though, it'll be easier to understand like this:
~ $ cat foo
<property name="sourceUrl" value="someurl?param=val"></property>
~ $ searchString='\(<property *name="sourceUrl" *value="\)[^?]*'
~ $ replacementString='file:///tmp/abc-efg'
~ $ sed -e "s~${searchString}~\1${replacementString}~g" foo
<property name="sourceUrl" value="file:///tmp/abc-efg?param=val"></property>