Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Syntax question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116066] Syntax question
  • From: Chris Degnen <degnen at cwgsy.net>
  • Date: Tue, 1 Feb 2011 06:50:50 -0500 (EST)

Can anyone say what the exclamation mark is doing in the example
below?:

StringReplace["acgttttccctgagcataaaaacccagcaatacg",
 RegularExpression["a..c."] :>
  "\!\(\*StyleBox[\"$0\",FontSize->14,FontWeight->\"Bold\"]\)"]

The example is from An Introduction to Programming with M., page 163.

The commentary reads: "... we use a regular expression to look for the
pattern consisting of the character "a" repeated one or more times,
followed by the character "c", followed by any character. The
StringReplace function then replaces any expression matching this
pattern with a large, bold formatted expression. The "$0" is used to
refer to the matched pattern."


  • Prev by Date: Re: Parculiarities of FindRoot
  • Next by Date: Re: Parculiarities of FindRoot
  • Previous by thread: Re: Parculiarities of FindRoot
  • Next by thread: Re: Syntax question