You should be more specific or a least give a snippet of code, since ReplaceAll replaces only one (and only the first replacement rule that matches)
Try this and notice that the rule is used only once.
Range[5]/. {left___, x_, y_, right___} :> {left, {x, y}, right}
If you have two rules, only the first that matches is used, and only once (ReplaceAll is /. )
ReplaceAll[
Range[5], {{left___, x_, y_, right___} :> {left, {x, y},
right}, {left___, x_, y_, z_, right___} :> {left, {x, y, z},
right}}]
If you would like to make all the replacements possible, than you need to use ReplaceList
ReplaceList[
Range[5], {left, x, y, right} :> {left, {x, y}, right}]
or
ReplaceList[
Range[5], {{left___, x_, y_, right___} :> {left, {x, y},
right}, {left___, x_, y_, z_, right___} :> {left, {x, y, z},
right}}]
So, it matters which replacement instructions is used (there are more than just the two I mentioned)