Quantcast
Channel: Active questions tagged string-manipulation - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 188

Position and string patterns

$
0
0

I am trying to get Position work with patterns.I have the following code:

dat = {"star", "u", "g", "r", "i", "z", "star2", "u", "g", "r", "i", "z", "star3", "u", "g", "r", "i", "z", "star4", "u", "g", "r", "i","z", "Astro", "u", "g", "r", "i", "z"};Position[dat, "star" ~~ _]Position[dat, RegularExpression["star."]]

Netheir returns anything. What I want is to return position of "star", "star2" etc. How do I properly use patterns with Position?


Viewing all articles
Browse latest Browse all 188

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>