Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15961 > unrolled thread

Re: Pattern matching in lists

Started byDrMajorBob <btreat1@austin.rr.com>
First post2011-02-03 10:30 +0000
Last post2011-02-03 10:30 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Pattern matching in lists DrMajorBob <btreat1@austin.rr.com> - 2011-02-03 10:30 +0000

#15961 — Re: Pattern matching in lists

FromDrMajorBob <btreat1@austin.rr.com>
Date2011-02-03 10:30 +0000
SubjectRe: Pattern matching in lists
Message-ID<iie03i$bld$1@smc.vnet.net>
MatchQ[{1, 3, 2, 6, 5, 1, 4, 6, 3, 9}, {___, 1, 4, 6, ___}]

True

Bobby

On Wed, 02 Feb 2011 05:07:02 -0600, Harvey P. Dale <hpd1@nyu.edu> wrote:

> MemberQ easily tests whether a single integer appears in a list
> of integers.  Suppose, however, that I want to test not for a single
> integer but for two or more consecutive integers, e.g., to see whether
> {1,4,6} is a member of {1,3,2,6,5,1,4,6,3,9}.  I can do this by
> converting both lists into strings and then using string-matching
> functions, but is there some way of doing it directly without that
> conversion?
>
> Thanks.
>
> Harvey
>
> Harvey P. Dale
> University Professor of Philanthropy and the Law
> Director, National Center on Philanthropy and the Law
> 139 MacDougal Street
> New York, N.Y. 10012-1076
> Tel: 212-998-6161
> Fax: 212-995-3149
> =09
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>


-- 
DrMajorBob@yahoo.com

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web