Attributing Find results to a variable

Get help using and writing Nisus Writer Pro macros.
Post Reply
js
Posts: 229
Joined: 2007-04-12 14:59:36

Attributing Find results to a variable

Post by js » 2009-06-19 00:02:27

I forgot how this works: In a find expression like Find Next “(part1)(part2)“
How do I attribute part1, part2 separately to variables?

Kino
Posts: 400
Joined: 2008-05-17 04:02:32

Re: Attributing Find results to a variable

Post by Kino » 2009-06-19 08:42:10

That is $ option. You can use it in the following manner.

Code: Select all

Find Next '(\w+) (\w+)', 'E$'
exit "1st word: $1, 2nd word $2"
or

Code: Select all

Find Next '(?<word1>\w+) (?<word2>\w+)', 'E$'
exit "1st word: $word1, 2nd word $word2"

js
Posts: 229
Joined: 2007-04-12 14:59:36

Re: Attributing Find results to a variable

Post by js » 2009-06-20 12:26:02

Thank you. This opens many possibilities. I was not aware of this.

Post Reply