# How to match a particular word except for occurrences in square brackets

**URL:** <https://forum.xbench.net/t/how-to-match-a-particular-word-except-for-occurrences-in-square-brackets/350>\
**Category:** Technical Support\
**Created:** [April 9, 2018, 11:28am UTC](https://forum.xbench.net/t/how-to-match-a-particular-word-except-for-occurrences-in-square-brackets/350 "2018-04-09T11:28:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivaylo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/ivaylo/32/14_2.png) [@ivaylo](https://forum.xbench.net/u/ivaylo)\
**Post date:** [April 9, 2018, 11:28am UTC](https://forum.xbench.net/t/how-to-match-a-particular-word-except-for-occurrences-in-square-brackets/350/1 "2018-04-09T11:28:12Z")

</div>

Hello,

I’m trying to use regex in the search field to find all strings containing the word “organization” but not when it occurs in between square brackets:

Example strings:

The organization “[organization name]” must contain at least one user per organization.  
The ID [id] for [organization] must contain digits only

I try to use: (?:^|\s)(organization)(?!])

but it fails because of the negative lookahead (i guess)

It seems to work in other flavors  
[https://regex101.com/r/tG7kC0/1](https://regex101.com/r/tG7kC0/1)

---

<div class="post-metadata">

**Author:** ![pcondal](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/pcondal/32/305_2.png) [@pcondal](https://forum.xbench.net/u/pcondal)\
**Post date:** [April 9, 2018, 6:39pm UTC](https://forum.xbench.net/t/how-to-match-a-particular-word-except-for-occurrences-in-square-brackets/350/2 "2018-04-09T18:39:05Z")

</div>

Lookaheads and lookbehinds are not supported in POSIX regex, which is the one [supported by Xbench](http://forum.xbench.net/t/which-regex-flavor-does-xbench-use/48).

Perhaps one possible workaround for what appears to be your use case could be to export the segments with Xbench as tab-delimited, do a global change of square brackets (`[]`) with angle brackets (`<>`) and load the tab-delimited file into Xbench. Then you can search or QA with the \*Ignore tags setting.
