Hi,
The new Power Find with browser and and meta character items for Power Find Pro is awesome. In its documentation I could not find a command for quoting regex meta characters such as \Q … \E or quotemeta. Is there one? I am searching for such a command because the patterns are simple enough, which makes it unnecessary to delve further into Nisus Writer Macro than the search and replace commands available.
Regards,
Martin
Power Find(regex) quote meta characters
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Power Find(regex) quote meta characters
Hi Martin: yes you can use \Q...\E to escape meta characters in a regex find pattern. That works in both the regular Find panel and Nisus Writer Pro macros.
Here's a quick example Nisus Writer macro:
That will match the text:
Here's a quick example Nisus Writer macro:
Code: Select all
$sub = @string<\d+ \w+>
Find All @String<T\w+ \Q$sub\E \w+>, 'E'
But will not match:Test \d+ \w+ end
Test 123 word end
Re: Power Find(regex) quote meta characters
Hi,
Thank you Martin, that does work. I do not know why I did not get that to work. Together with FollowedBy and the other zero-width matches it solves many problems.
Thanks,
Martin
Thank you Martin, that does work. I do not know why I did not get that to work. Together with FollowedBy and the other zero-width matches it solves many problems.
Thanks,
Martin