Question: I am a beginner and I would like to ask you something.

We have an array whose size depends on value input by user in a variable ‘arraysize’. Look at below code and comments please, is it a correct way to achieve this said be behaviour?

```
int * myArray = NULL;
int arraySize;
cout << "Enter array size: ";
cin >> arraySize;
myArray = new int[arraySize];
delete [] myArray;

```

Answer: 
You want to replace `abc` only at the start of a word and only when it is not followed with another letter. Use

```
replaceAll("\\bapp(?![a-zA-Z])", "code")

```

If you want `abc` to be followed with a word boundary or underscore, the pattern can also be 

```
"\\bapp(?=\\b|_)"

```
Try this:

```
public static void main(String []args){
        Assert.assertEquals("code", repl("app"));
        Assert.assertEquals("code_abc",repl("app_abc"));
        Assert.assertEquals("appabc",repl("appabc"));
        Assert.assertEquals("appa_bc",repl("appa_bc"));
        Assert.assertEquals("fooapp",repl("fooapp"));
        Assert.assertEquals("foo_app",repl("foo_app"));
        System.out.println("All Good");
    }

    private static String repl(final String str) {
        return str.replaceAll("\\bapp(?![a-zA-Z])", "code");
    }

```