KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
What is the most efficient or elegant method for matching brackets in a string such as: "f @ g[h[[i[[j[2], k[[1, m[[1, n[2]]]]]]]]]] // z" for the purpose of identifying and replacing [[ Part ]] brackets with the single character forms? I want to get: With everything else intact, such as the prefix @ and postfix // forms intact An explanation of Mathematica syntax for those unfamiliar: Functions use single square brackets for arguments: func[1, 2, 3] Part indexing is done with double square brackets: list[[6]] or with single-character Unicode double brackets: list〚6〛 My intent is to identify the matching [[ ]] form in a string of ASCII text, and replace it with the Unicode characters 〚 〛
Tags (comma-separated)
Save Edits
Cancel