parsing - How do I get auto-conversion of Part [[ double-brackets ]] on paste? -


I have a pet herd, using double square brackets for part instead of a letter < Code> \ [LeftDoubleBracket] and \ [RightDoubleBracket] . After pasting a plain-text code in the Mathematica notebook (for example, with stack overflow), I want to change it automatically, I am unable to configure it.

Can it be done with ImportAutoReplacements or any other automated method (preferred), or I'll need to use a method like "paste tabular data palette" referenced ?

Either way, I'm not good with string parsing, and I want to learn the best way to handle the calculation of brackets.


Sjoerd sighed, Code> delegation and Simon Ctrl + Shift + n which both of the math Has been created due to the automatic format code. These are good alternatives.

I still am interested in any method that automatically and / or protects as original code as possible For example, maintaining prefix f @ 1 , infix 1 ~ f ~ 2 , and postfix 1 // f in their original forms > Maintain function. / P>


This question was posted as a sub-section and received many good answers.

There really is no answer, but double using a single keystroke [] The couple came to the math group a few weeks before entering the pair (with the cursor between the two pairs). It does not help me, but apparently it was a solution for others.

Edit
My little closed-subject seems to work on a pattern replacement here to make good on the first reaction (although I have difficulties to understand Why it should be B. and not B_, the latter does not work):

  delete [F [g [h [[i [[j [2], k [[1, m [[1, n [2]]]]] /] Holdparten [Part [B, A_]] - & gt; HoldPattern [b] [LeftDoubleBracket] a \ [RightDoubleBracket]]   

Enter the image </ Strong> <p> <strong> Edit 2 </ strong> I have come to know that if you import the above rule, add it to publish the publication and paste your SO code into notebook [] and Evaluate it, you end up with a double bracket with a usable form which can be used as input elsewhere. </ P> <p> <strong> 3 Edit </ strong> <br> As the comment given below, invisibly, the srijogist has commented, the replacement rule is not necessary, it takes it on itself! Scientific progress to refer to Bill Watson,

 boink

Edit 4
The jury is still out on the deaf, there are some strange side effects in it, and do not work well on all expressions. Trying to paste the "Paste tabular data palette" for example, lets me block the code and execute it:
Palette

It worked very well from one thread to another code snippet:

 Enter the image details here

The second part is to see how it looks after editing the output of the first block and changing it in the input (originally, Pu Two returns to Rsthapit couple) it turns into input Please note that all double bracket turned into the corresponding symbol, but also see the changing conditions of release Hall.

Comments