# Regular expression to look for malformed placeholders

**URL:** <https://forum.xbench.net/t/regular-expression-to-look-for-malformed-placeholders/1323>\
**Category:** Technical Support\
**Created:** [October 22, 2025, 12:22pm UTC](https://forum.xbench.net/t/regular-expression-to-look-for-malformed-placeholders/1323 "2025-10-22T12:22:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wildina7](https://avatars.discourse-cdn.com/v4/letter/w/5fc32e/32.png) [@wildina7](https://forum.xbench.net/u/wildina7)\
**Post date:** [October 22, 2025, 12:22pm UTC](https://forum.xbench.net/t/regular-expression-to-look-for-malformed-placeholders/1323/1 "2025-10-22T12:22:32Z")

</div>

Hi everyone,

I have a file where the source contains 2 types of important placeholders:

1. {Platform}|platform(XXXX, XXXX, XXXX)

Example: {Platform}|platform(controller, controller, mouse/keyboard)

1. {Gender}|gender(“XXXX”, “XXXX”)

Example: {Gender}|gender(“boy”, “girl”)

I need a check to make sure that these placeholders maintain the same structure in the target, where only XXX would differ.

Can you help me?

---

<div class="post-metadata">

**Author:** ![omartin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/omartin/32/82_2.png) [@omartin](https://forum.xbench.net/u/omartin)\
**Post date:** [October 28, 2025, 11:21am UTC](https://forum.xbench.net/t/regular-expression-to-look-for-malformed-placeholders/1323/2 "2025-10-28T11:21:51Z")

</div>

Try the following searches:

1. Platform placeholder:  
Source: `"(\{Platform\}\|platform)=1\([^,]+, [^,]+, .+\)"`  
Target: `-"@1\([^,]+, [^,]+, .+\)"`  
Search mode: Regular Expressions  
PowerSearch: On
2. Gender placeholder:  
Source: `"(\{Gender\}\|gender)=1\(""[^""]+"", ""[^""]+""\)"`  
Target: `-"@1\(""[^""]+"", ""[^""]+"" \)"`  
Search mode: Regular Expressions  
PowerSearch: On

---

<div class="post-metadata">

**Author:** ![wildina7](https://avatars.discourse-cdn.com/v4/letter/w/5fc32e/32.png) [@wildina7](https://forum.xbench.net/u/wildina7)\
**Post date:** [November 23, 2025, 5:49pm UTC](https://forum.xbench.net/t/regular-expression-to-look-for-malformed-placeholders/1323/3 "2025-11-23T17:49:44Z")

</div>

> [@omartin](#):
>
> “({Gender}|gender)=1(”“[^”“]+”“, “”[^”“]+”“)”

Hi omartin,

the platform one worked, thanks a lot!

For the gender one, I get the error:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/xbench/original/1X/10befcf816afda46cdedffab0a6038cbfce65df0.png)

---

<div class="post-metadata">

**Author:** ![omartin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/omartin/32/82_2.png) [@omartin](https://forum.xbench.net/u/omartin)\
**Post date:** [November 25, 2025, 12:01pm UTC](https://forum.xbench.net/t/regular-expression-to-look-for-malformed-placeholders/1323/4 "2025-11-25T12:01:51Z")

</div>

> [@omartin](#):
>
> Gender placeholder:  
> Source: `"(\{Gender\}\|gender)=1\(""[^""]+"", ""[^""]+""\)"`  
> Target: `-"@1\(""[^""]+"", ""[^""]+"" \)"`  
> Search mode: Regular Expressions  
> PowerSearch: On

Try the above fixed search.
