MathGroup Archive 2011

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

Search the Archive

Re: Replace

  • To: mathgroup at
  • Subject: [mg121076] Re: Replace
  • From: Murray Eisenberg <murray at>
  • Date: Fri, 26 Aug 2011 05:24:15 -0400 (EDT)
  • Delivered-to:
  • References: <>
  • Reply-to: murray at

Did you make a typographic error and really mean to type "5/6"? While an 
expression such as (5|6) is a legitimate Mathematica expression, it is 
not evaluated further with those arguments. However, the | symbol is a 
special input for for the function Alternatives, which may be used to 
form patters for patter-matching purposes; is that what you want?

If not, then please explain further what you want. Are you starting with 
actual length-2 lists of integers or, instead, lists of strings 
representing those integers? Do you want the raw (5|6) type expression 
or a string looking like that.

On 8/25/11 7:06 AM, Sam Korn wrote:
> Hi, another stupid question. I have a list, and each element in the list is
> a sublist with a pair of integers. How do I replace each element along the
> lines of "{5,6}" with "(5|6)"?
> I know it's a stupid question, and there's probably something really obvious
> I'm missing, but I'm really new to Mathematica.
> Thanks!
> -Sam

Murray Eisenberg                     murray at
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

  • References:
    • Replace
      • From: Sam Korn <>
  • Prev by Date: Re: Replace
  • Next by Date: Re: Execute commands with CDF player
  • Previous by thread: Re: Replace
  • Next by thread: Re: Replace