Does anyone know how to turn RawBoxes into an expression?
In particular, I am looking at the first part of
WolframLanguageData["List", "DocumentationBasicExamples"](*[[1,1]] looks like List[a,b,c,d]*)
I was hoping for a held expression or something that is Inactive.
Thanks everyone. I woke up in the middle of the night realizing that NotebookImport[Notebook[AllCases[expr,_Cell]] would work. Only learned about NotebookImport a few days ago although it's been around for a couple years.
NotebookImport[Notebook[AllCases[expr,_Cell]]
Thanks Carl. I was looking for something that could be done automatically, and maybe one way is to use CellPrint and then a NotebookImport to get the Input cells.
Also thanks Data Computist. Apparently MakeExpression is making an ExpressionCell object, which presumably is something that can be ignored.
I guess that MakeExpression is an old function, while AllCases is a new one (which could replace Cases[...,Infinity])
In[]:= Cases[WolframLanguageData["List","DocumentationBasicExamples"],c_Cell :>MakeExpression[c,StandardForm],Infinity] Out[]= {HoldComplete[{a,b,c,d}],HoldComplete[{a,b,c,d}],HoldComplete[List[a,b,c,d]],HoldComplete[{a,b,c,d}]}
Perhaps you could do:
Cases[WolframLanguageData["List","DocumentationBasicExamples"],cell_Cell:>CellPrint@cell,Infinity]; List[a,b,c,d] {a,b,c,d} FullForm[{a,b,c,d}] List[a,b,c,d]