Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this line of code (a one-liner to import the Abaqus dispalcements!)

displacements = 
        "------------------------------\n([.\\s\\S]*)Minimum"] -> \
{"$1"}][[1, 1]], "Table"], {}][[
  All, {1, 3, 4}]];(* drop the 2nd column = U.Magnitude *)

This line gives a trouble in the auto-intendation when sometimes the * ) in the RegularExpression matches with an opening (* somewhere earlier.

One solution to correct the wrong formatting (I know) is to delete the *) and retype it.

Anyone else faces such trouble in the front-end? Any way to avoid it?

I am on M8

share|improve this question

I don't think you can avoid completely it since comments behave like:

Here is code (* comment " comment *) more code

But you can split the string up:

"part1*)part2" == "part1*"<>")part2"

Unrelated observations:

Although I do find it strange you can't escape "*" nor ")" with "\"

"\)" != ")"
"\)" != "\\)" (* Theese  two print as the same *)
StringMatchQ["\)", "\\)"] (* False *)
StringTake["\\)", {1}]    (* "\\" *)
StringTake["\)", {1}]     (* "\)" huh? *)
ToCharacterCode["\)"]     (* {63424} something in unicode PUA *)
""=="\)"                 (* True, displays as "\)"=="\)" on input *)
FullForm[\( 1 \)]         (* "1" *)

What is this \( \) thing? EDIT: nevermind, it's RowBox

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.