Re: Removing (or replacing) substrings in a string array [message #87274 is a reply to message #87270] |
Wed, 22 January 2014 07:58   |
Mats Löfdahl
Messages: 263 Registered: January 2012
|
Senior Member |
|
|
Den onsdagen den 22:e januari 2014 kl. 16:34:26 UTC+1 skrev Mats Löfdahl:
>
> Maybe that is part of the solution.
Indeed it is!
In my own example I had these two calls:
stregex(strlist,'(\.|^)[0-9]{5}(\.|$)',/extr)
stregex(strlist,'(\.|^)f[+-][0-9]+(\.|$)',/extr)
If I rewrite them like this
stregex(strlist,'(\.|^)([0-9]{5})(\.|$)',/extr,/subexp)
stregex(strlist,'(\.|^)(f[+-][0-9]+)(\.|$)',/extr,/subexp)
I get 2D string arrays. And I can get a list of the field I'm interested in by doing
(stregex(strlist,'(\.|^)([0-9]{5})(\.|$)',/extr,/subexp))[2, *]
(stregex(strlist,'(\.|^)(f[+-][0-9]+)(\.|$)',/extr,/subexp)) [2,*]
Thank you Matthew!
|
|
|