# RegEx Upper / lower case sequence

**URL:** <https://forum.xbench.net/t/regex-upper-lower-case-sequence/463>\
**Category:** Technical Support\
**Created:** [March 7, 2019, 12:23pm UTC](https://forum.xbench.net/t/regex-upper-lower-case-sequence/463 "2019-03-07T12:23:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Susanne](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@Susanne](https://forum.xbench.net/u/Susanne)\
**Post date:** [March 7, 2019, 12:23pm UTC](https://forum.xbench.net/t/regex-upper-lower-case-sequence/463/1 "2019-03-07T12:23:14Z")

</div>

RegEx requested for:  
Upper case sequence followed by lower case without any white space between them (see example in target).

Background:  
Random copy and paste issue.

Example:  
Source:  
This DTC is stored when a malfunction occurs.

Target:  
ELECTRIC EGR CONTROL VALVE ASSEMBLYDieser DTC wird gespeichert, wenn eine Funktionsstörung vorliegt.

Thanks in advance.

Susanne.

---

<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:** [March 7, 2019, 2:57pm UTC](https://forum.xbench.net/t/regex-upper-lower-case-sequence/463/2 "2019-03-07T14:57:13Z")

</div>

Hi Susanne,

The following regular expression should display all segments that contain 2 or more Upper case followed by 2 or more lowercase without any whitespaces between them.

Target: `<[A-Z]{2,}[a-z]{2,}>`  
Search mode: Regular Expressions  
Case Sensitive checkbox: on.

Depending on the target language, it is necessary to add special characters such as ß, ä, etc. between square brackets.  
For instance, in German it would be `<[A-ZßÄËÏÖÜ]{2,}[a-zßäëïöü]{2,}>`.

Best regards,  
Oscar.

---

<div class="post-metadata">

**Author:** ![Susanne](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@Susanne](https://forum.xbench.net/u/Susanne)\
**Post date:** [March 7, 2019, 3:30pm UTC](https://forum.xbench.net/t/regex-upper-lower-case-sequence/463/3 "2019-03-07T15:30:42Z")

</div>

Hi Oscar,

It works like a charm! Thanks a lot for your speedy reply.

Your help is much appreciated.

With kind regards,  
Susanne.

---

<div class="post-metadata">

**Author:** ![Susanne](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@Susanne](https://forum.xbench.net/u/Susanne)\
**Post date:** [June 4, 2019, 1:27pm UTC](https://forum.xbench.net/t/regex-upper-lower-case-sequence/463/4 "2019-06-04T13:27:08Z")

</div>

Hi again,

This is a follow up:

RegEx requested for:  
Upper case sequence **including hyphens** followed by lower case without any white space between them (see example in target).

Background:  
Random copy and paste issue.

Source:  
The door control receiver receives a signal.

Target:  
Smart-key-ECU-EinheitDer Türsteuerungsempfänger empfängt ein Signal.

Thanks in advance.

Susanne.

---

<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:** [June 4, 2019, 3:53pm UTC](https://forum.xbench.net/t/regex-upper-lower-case-sequence/463/5 "2019-06-04T15:53:59Z")

</div>

The following search should find segments like your sample:

Target term or Source term: `"[A-Z][a-z]+(\-[:letter:]+){2,}"`  
Search Mode: Regular Expressions  
Case-sensitive checkbox: On.  
PowerSearch: On. (Press Ctrl+P to run the search).

This search will find Smart-key-ECU-Einheit but not Smart-key to avoid displaying compound words.

---

<div class="post-metadata">

**Author:** ![Susanne](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@Susanne](https://forum.xbench.net/u/Susanne)\
**Post date:** [June 5, 2019, 2:40pm UTC](https://forum.xbench.net/t/regex-upper-lower-case-sequence/463/6 "2019-06-05T14:40:45Z")

</div>

Thanks a lot! It does find my term, but it also gives too many false hits like the following:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/xbench/original/1X/ec24a8e03553a4eaced7e900eb20e032ec80f5f7.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:** [June 5, 2019, 2:59pm UTC](https://forum.xbench.net/t/regex-upper-lower-case-sequence/463/7 "2019-06-05T14:59:45Z")

</div>

A way to discard false alarms would be to search this type of string followed by a word starting with an uppercase.

Target term or Source term: `"[A-Z][a-z]+(\-[:letter:]+){2,}[A-Z][a-z]+>"`  
Search Mode: Regular Expressions  
Case-sensitive checkbox: On.  
PowerSearch: On. (Press Ctrl+P to run the search).
