MathGroup Archive 2005

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

Search the Archive

refering to a long pattern by a variable

  • To: mathgroup at
  • Subject: [mg57713] refering to a long pattern by a variable
  • From: marloo3 at
  • Date: Mon, 6 Jun 2005 04:21:22 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

i wish if i could refer to a long pattren by just a variable,
suppose the:
and the pattern to search is "b"~~___~~"c"
StringCases[txt, ShortestMatch["b" ~~ ___ ~~ "c"], Overlaps -> False]
Out[]={bc, bac, bzzc}
ok, i hope there is a way to supply just the :
and some procedure will make the "b" ~~ ___ ~~ "c" from the above pat variable 
and assign this pattern to pat2 variable so we just write:
ShortestMatch[pat2], Overlaps -> False]
to give the output 
Out[]={bc, bac, bzzc}
i have tried it by StringJoin but it does not work.

  • Prev by Date: Re: Viewing algebraic results
  • Next by Date: character range on lower case script alphabet
  • Previous by thread: Making good looking thumbnails with Mathematica?
  • Next by thread: Re: refering to a long pattern by a variable