I'm describing how you write something down (specifically, an array initializer in JavaScript, but that's not important), and find myself intrigued by the choice of using "separated by" vs. "separated with." I wonder if there are rules, or whether it doesn't really matter which you use.

As a native English speaker (mostly of American English but influenced by British English), my largely unschooled instinct is that "separated by" is more of an observation of fact ("As we can see in the diagram, the entries are separated by commas"), and that "separated with" is more related to an instruction ("When writing...put the entries between the square brackets, separated with commas")... I think part of the reason I feel that tug toward "with" is that I'd *definitely* use "with" in the imperative sentence "Separate the entries with commas."

Is there language logic to back that up? And/or is my unschooled instinct simply wrong? :-)

In this case, I'm primarily interested in informal but professional American English usage.