On Wed, 26 Feb 2020 04:32:43 +0000, Seymour J Metz wrote:
>Absent a problem description, there's no way to tell whether that does what
>the OP wants; does he want to treat the last word containing a period as
>fn.fext, or the fourth word? Does he want to allow multiple periods in the
>name, e.g., foo.bar.text? I could write a regex for any of these, but not
>without knowing which, if any, of them is correct.
>
He said only, "I wanted to parse out the string 'word3' using the period as a
place holder."
So, how about:
trace R
myVar = 'word1 word2 9.12 word3.ext'
Parse Var myVar . 'word3' +0 myVal +5 .
2 *-* myVar = 'word1 word2 9.12 word3.ext'
>=> "word1 word2 9.12 word3.ext"
3 *-* Parse Var myVar . 'word3' +0 myVal +5 .
>V> "word1 word2 9.12 word3.ext"
>.> "word1 word2 9.12 "
>>> "word3"
>.> ".ext"
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN