Regular expression expert needed

Job ID: 32398096

Budget: $8 – $15 USD

I need a regular expression expert with experience Dreamweaver. We use Dreamweaver sometimes as our code editor. There we search source codes to find out certain codes. Here is the details.....

In C/C++ styling we can write comments in three ways.

One:
/**
**** foo is something **
**********/

Two:
// here is my foo

Three:
/* single line comment with foo ***/

Now I want to match all occurrences of the word foo outside of all comment. If foo is present inside the comment, regex should avoid it. I want an expert to give me a quick regex ready pattern.