Attributing Find results to a variable

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

Attributing Find results to a variable

Post by js »

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 »

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: 259
Joined: 2007-04-12 14:59:36

Re: Attributing Find results to a variable

Post by js »

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