How to use "bmesh.ops.subdivide_edges" on selected edges
I assume you are doing edit operations

Make sure you are using bmesh.from_edit _mesh to get the selected edge information. When doing from_mesh all edges will be selected.

bm = bmesh.from_edit_mesh(my_mesh)
selected_edges = [edge for edge in bm.edges if edge.select]
bmesh.ops.subdivide_edges(bm, edges=selected_edges, cuts=100)
bmesh.update_edit_mesh(my_mesh)


Note that .faces has an .active helper property what does this for faces. A similar API for edges is not available, hence you need to use the list comprehension.