I tried the example on page 37 of the Cadabra Book
ex:= A + B3 + C7;
substitute(_, $A + M? + N? | \regex{M?}{"[A-Z]7"} -> \sin(M? N?\)/N?$);
In jupyter I got this error :
Traceback (most recent call last):
File "/usr/local/lib/python3.12/dist-packages/cadabra2_jupyter/kernel.py", line 57, in do_execute
self._execute_python(pycode)
File "/usr/local/lib/python3.12/dist-packages/cadabra2_jupyter/kernel.py", line 111, in _execute_python
self._sandbox_context(pycode)
File "/usr/local/lib/python3.12/dist-packages/cadabra2_jupyter/context.py", line 51, in __call__
exec(code, self._sandbox)
File "<string>", line 2
substitute(_, ""Ex(r'''A + M? + N? | \regex{M?}{"[A-Z]7"} -> \sin(M? N?)/N?''', False)); display(_)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
The command line simply crash :
> ex:= A + B3 + C7;
A + B3 + C7
> substitute(_\, $A + M? + N? | \regex{M?}{"[A-Z]7"} -> \sin(M? N?)/N?$);
Terminated by user interrupt.
I'm using Cadabra 2.5.12