I am running into a silly problem with Regular Expressions in Java where I would like to match a String that begins with @ with characters from a certain valid set, but are not preceded by characters from the same valid set.

The terms I would like to match are of the form:

"y" + @ + "xxxxxxx"

where:

* x is a character that belongs to the valid set `[a-zA-Z\\d\\-\\_]`
* the @ sign appears once
* y is a character that does **not** belong to the valid set `[a-zA-Z\\d\\-\\_]`

I'm currently trying to do this this by using the following regular expressions pattern

```
MY_PATTERN = "[^[A-Za-z\\d\\-\\_]?]" + "@{1}" + "[A-Za-z\\d\\-\\_]+"
String text = "12a@cat123-_     @dog123__- ";
Pattern p = Pattern.compile(PATTERN);
Matcher m = p.matcher(text);

```

Based on this I expect the following code to only print `@dog123__-`

`while(m.find()){
 String s = m.group();
 System.out.println(s);
}`

However it also prints out `a@cat123-_`.

Could someone explain what I'm doing wrong?