Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: StringMatchQ and Regular Expressions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88501] Re: StringMatchQ and Regular Expressions
  • From: Albert Retey <awnl at arcor.net>
  • Date: Tue, 6 May 2008 06:46:05 -0400 (EDT)
  • References: <fvhdu8$3p6$1@smc.vnet.net>

Mark Westwood schrieb:
> 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
> 

See also StringFreeQ and the section
"Properties & Relations  (3)" in its homepage.

hth,

albert


  • Prev by Date: Symbolic Optimization Problem
  • Next by Date: Re: Finding the line that caused an error
  • Previous by thread: Re: StringMatchQ and Regular Expressions
  • Next by thread: Re: StringMatchQ and Regular Expressions