Environment
- Qiskit version: 2.2.3
- Python version: 3.13
- Operating system: macOS
What is happening?
The OQ3 exporter does not escape identifiers that start with an ASCII digit, even though this is invalid OQ3. The regex checking for valid identifiers is broken.
How can we reproduce the issue?
from qiskit import qasm3, QuantumCircuit, ClassicalRegister, QuantumRegister
qc = QuantumCircuit(QuantumRegister(3, name="3qr"), ClassicalRegister(2, name="2cr"))
print(qasm3.dumps(qc))
OPENQASM 3.0;
include "stdgates.inc";
bit[2] 2cr;
qubit[3] 3qr;
What should happen?
The register names should be escaped; they're invalid.
Any suggestions?
No response