MathGroup Archive 2008

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

Search the Archive

StringMatchQ and Regular Expressions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88361] StringMatchQ and Regular Expressions
  • From: Mark Westwood <markc.westwood at gmail.com>
  • Date: Sat, 3 May 2008 06:14:42 -0400 (EDT)

Hi

I'm running Mathematica v6.0.2 on Windows XP.

I define a regex thus:

doStmt = RegularExpression["do(?=\\s*\\w+=)"];

and then execute:

StringCases["doindex= ", doStmt]

which brings the response

{do}

I then execute

StringMatchQ["doindex= ", doStmt]

which brings the response

False

I had expected that if StringCases found any cases, then StringMatchQ
would return True.  Obviously this is not the case, but can anyone out
there throw light upon this.

Thanks for any insights you can give me

Mark Westwood


  • Prev by Date: Re: Convert funcion
  • Next by Date: Getting the size of the bounding box of a Graphics3D[]
  • Previous by thread: Re: can't translate 3D model to 0,0,0
  • Next by thread: Re: StringMatchQ and Regular Expressions