# REGEXP to find one character exactly once in a segment

**URL:** <https://forum.xbench.net/t/regexp-to-find-one-character-exactly-once-in-a-segment/1058>\
**Category:** Technical Support\
**Created:** [September 25, 2023, 11:28am UTC](https://forum.xbench.net/t/regexp-to-find-one-character-exactly-once-in-a-segment/1058 "2023-09-25T11:28:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jussi](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/jussi/32/418_2.png) [@Jussi](https://forum.xbench.net/u/Jussi)\
**Post date:** [September 25, 2023, 11:28am UTC](https://forum.xbench.net/t/regexp-to-find-one-character-exactly-once-in-a-segment/1058/1 "2023-09-25T11:28:35Z")

</div>

I never found a solution to the original problem, so I’m reframing it:

Is it possible to write a RegExp to match if a segment has one spesific character _once and just once_.  
(In practice, I want to spot a lone " in a segment)

Original issue and background: [Unpaired quotes false+](https://forum.xbench.net/t/unpaired-quotes-false/1004)

---

<div class="post-metadata">

**Author:** ![Amba](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@Amba](https://forum.xbench.net/u/Amba)\
**Post date:** [September 27, 2023, 8:05am UTC](https://forum.xbench.net/t/regexp-to-find-one-character-exactly-once-in-a-segment/1058/2 "2023-09-27T08:05:06Z")

</div>

This works for me:

Quotation marks to be used in target - ALT+0148: ”xxx”:

Source: leave blank  
Target: “|„|«|»|"|‘|’  
(RegEx)

I am not 100% sure what you mean by “just once”, but the above will check that your target does **not** contain any of the mentioned in the RegEx, which are the most common - in other words only “alt+0148”  
I hope it helps 🙂

---

<div class="post-metadata">

**Author:** ![Jussi](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/jussi/32/418_2.png) [@Jussi](https://forum.xbench.net/u/Jussi)\
**Post date:** [September 27, 2023, 8:40am UTC](https://forum.xbench.net/t/regexp-to-find-one-character-exactly-once-in-a-segment/1058/3 "2023-09-27T08:40:29Z")

</div>

Thank you Amba!

However, I think I did not explain well enough. I want to spot unpaired quotes, like this:

1. THIS IS OK, should not match: correct ”xxx” quotes
2. THIS IS WRONG, should match: incorrect ”xxx quotes, closing is missing

So, why I don’t just use the built-in quote check? Because XBench does not understand that 1) is correct, but reports all such segments (because it thinks that it should be “xxx”, like in English.
