Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

When a string does not match itself

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97198] When a string does not match itself
  • From: <ingolf.dahl at telia.com>
  • Date: Sat, 7 Mar 2009 02:42:57 -0500 (EST)
  • Organization: University of Gothenburg
  • Reply-to: <ingolf.dahl at physics.gu.se>

This is a maybe a trivial question, but I have not found the explanation in
help (I am using Mathematica 7.0.0):

 

Normally a string matches itself:

 

In[270]:= StringMatchQ["monkey", "monkey"]  

Out[270]= True

 

But 

 

In[271]:= StringMatchQ["\\*", "\\*"]  

Out[271]= False

 

Why? Compare also to

 

In[4]:= StringCases["\\*", "\\*"]   

Out[4]= {"\\*"}

 

In[267]:= StringPosition["\\*", "\\*"]  

Out[267]= {{1, 2}}

 

Best regards

 

Ingolf Dahl

Sweden

ingolf.dahl at telia.com




  • Prev by Date: Re: Style for function calls?
  • Next by Date: Re: Mathematica 7.0.1.0 and some General Comments
  • Previous by thread: Re: Wolfram/Alpha
  • Next by thread: Re: When a string does not match itself