set sourceString to ((characters 1 thru (positionOfMatch - 1) of sourceString) as string) & substitutionString & (characters (positionOfMatch + (length of searchString)) thru (length of sourceString) of sourceString) as string