# Help me to modify regular expression that is used for PL/SQL syntax highlighting

**URL:** <https://forums.toadworld.com/t/help-me-to-modify-regular-expression-that-is-used-for-pl-sql-syntax-highlighting/28161>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [December 21, 2013, 1:44am UTC](https://forums.toadworld.com/t/help-me-to-modify-regular-expression-that-is-used-for-pl-sql-syntax-highlighting/28161 "2013-12-21T01:44:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fgsfds](https://avatars.discourse-cdn.com/v4/letter/f/cab0a1/32.png) [@fgsfds](https://forums.toadworld.com/u/fgsfds)\
**Post date:** [December 21, 2013, 1:44am UTC](https://forums.toadworld.com/t/help-me-to-modify-regular-expression-that-is-used-for-pl-sql-syntax-highlighting/28161/1 "2013-12-21T01:44:53Z")

</div>

I am experimenting with regular expressions in Toad Options \> Editor \> Behavior \> Syntax Highlighting \> Parser.

Looking to modify String: **(?s)(’|")(.\*?)(\1|\Z)** to match everything between quotes EXCEPT words that start with specific combination of character. For example xx\_ and xe\_

Output should be (matches are red):

cat dog ‘space xx\_cat rainbow xe\_space car cloud xx\_toad’ nothing

---

<div class="post-metadata">

**Author:** ![mstaszew](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/mstaszew/32/23_2.png) [@mstaszew](https://forums.toadworld.com/u/mstaszew)\
**Post date:** [December 21, 2013, 5:45pm UTC](https://forums.toadworld.com/t/help-me-to-modify-regular-expression-that-is-used-for-pl-sql-syntax-highlighting/28161/2 "2013-12-21T17:45:32Z")

</div>

At first glance I don't think that's possible with regex, but I have had several glasses of wine and I'm in a Christmas food coma at the moment. What's your use case for not wanting the entire string decorated uniformly?

On Dec 21, 2013, at 4:45 AM, "fgsfds" [bounce-fgsfds@toadworld.com](mailto:bounce-fgsfds@toadworld.com) wrote:

> **[Help me to modify regular expression that is used for PL/SQL syntax highlighting](http://www.toadworld.com/products/toad-for-oracle/f/10/t/21003.aspx)**

> Thread created by fgsfds  
> I am experimenting with regular expressions in Toad Options \> Editor \> Behavior \> Syntax Highlighting \> Parser.

> Looking to modify String: **(?s)('|")(.\*?)(\1|\Z)** to match everything between quotes EXCEPT words that start with specific combination of character. For example xx\_ and xe\_

> Output should be (matches are red):

> cat dog 'space xx\_cat  
> rainbow xe\_space  
> car cloud xx\_toad' nothing

> To reply, please reply-all to this email.
> 
> [Stop receiving emails](http://www.toadworld.com/products/toad-for-oracle/f/10/t/21003.aspx?subscribe=false) on this subject.
> 
> Or [  
> Unsubscribe from Toad for Oracle - General](http://www.toadworld.com/products/toad-for-oracle/f/10.aspx?subscribe=false) notifications altogether.
> 
> Toad for Oracle - Discussion Forum

> [Flag](http://www.toadworld.com/products/toad-for-oracle/f/10/t/21003.aspx?AbuseContentId=c62e8a28-24fd-40e1-9e0f-44d4a415999e&AbuseContentTypeId=46448885-d0e6-4133-bbfb-f0cd7b0fd6f7&AbuseFlag=true)  
> this post as spam/abuse.

> ![](https://global.discourse-cdn.com/quest/original/3X/5/0/50b30fd5f87c85fe5cba2635cb83316ca71250d7.gif)
> 
> * * *
> 
> No virus found in this message.
> 
> Checked by AVG - [www.avg.com](http://www.avg.com)
> 
> Version: 2014.0.4259 / Virus Database: 3658/6936 - Release Date: 12/20/13

---

<div class="post-metadata">

**Author:** ![fgsfds](https://avatars.discourse-cdn.com/v4/letter/f/cab0a1/32.png) [@fgsfds](https://forums.toadworld.com/u/fgsfds)\
**Post date:** [December 22, 2013, 2:28am UTC](https://forums.toadworld.com/t/help-me-to-modify-regular-expression-that-is-used-for-pl-sql-syntax-highlighting/28161/3 "2013-12-22T02:28:22Z")

</div>

Well, I am using background color for words that start with special prefixes like “xe\_” (Lots of such objects in my organization’s db). And I thought that it might be a nice idea to quickly find them in the big amount of code no matter where they are. Even in the string.

---

<div class="post-metadata">

**Author:** ![Bert\_Scalzo](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/bert_scalzo/32/274_2.png) [@Bert\_Scalzo](https://forums.toadworld.com/u/Bert_Scalzo)\
**Post date:** [December 22, 2013, 4:57am UTC](https://forums.toadworld.com/t/help-me-to-modify-regular-expression-that-is-used-for-pl-sql-syntax-highlighting/28161/4 "2013-12-22T04:57:35Z")

</div>

I agree - very, very useful idea - maybe should be placed on toad idea pond so we call can vote on it.

I just wanted to state the non-obvious - it should work in strings as well as comments. Because if people are following good commenting guidelines, then comments as well as strings need to be in scope. I think that you said this by saying everything -  
I’m just overstating it just to be sure 🙂

Bert
