# RegExp Code Keywords?

**URL:** <https://forum.kirupa.com/t/regexp-code-keywords/322027>\
**Category:** flash\
**Created:** [May 7, 2011, 4:31pm UTC](https://forum.kirupa.com/t/regexp-code-keywords/322027 "2011-05-07T16:31:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![noahssite](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@noahssite](https://forum.kirupa.com/u/noahssite)\
**Post date:** [May 7, 2011, 4:31pm UTC](https://forum.kirupa.com/t/regexp-code-keywords/322027/1 "2011-05-07T16:31:33Z")

</div>

I wrote a script that acts as a syntax highlighter highlighting keywords a certain colour. My issue is that the RegExp expression I am currently using is flawed:

```auto
this|var|int|String|Object|is|in

```

The issue with the script is that words within words will be highlighted for example using the above expression following will occur:

var what[COLOR=“blue”]is[/COLOR]:[COLOR=“Blue”]int[/COLOR] = 0;

int is highlighted correctly however I do not want is to be highlighted. How do I make it so the above list is found with the following conditions:

It can not be part of other letters/numbers/symbols  
The only symbols/characters that it can be beside are:

. : ? ( ) { } ! + - \* / % ^

Basically it’s a list of exceptions to what can be next to the keyword, on either side of it. How do I implement this? - What is the expression?
