Question: I'm trying to display a "log in" / "log out" link. I want to display the log in link if they are not logged in, etc. I'm having trouble getting this to work. Heres what I've been trying:

```
<?php if (isset($_SESSION['access_token'])) 
 { ?> <a href="logout.php">Log out</a><?php } ?>
<?php
else 
{ ?> <a href="login.php">Log In</a>  <?php } ?>

```

Basically, if the assess\_token is set, it will show a link to log out. And if not, a log in link. I keep getting this as an error: 

> 
> Parse error: syntax error, unexpected T\_ELSE
> 
> 
> 

And i've tried this variation:

```
<?php if (isset($_SESSION['access_token'])) 
{ echo "<a href="logout.php">Log out</a>" }
else 
{ echo "<a href="login.p">Log In</a>" } ?>

```

which get me: 

> 
> Parse error: syntax error, unexpected T\_STRING, expecting ',' or ';' 
> 
> 
> 

what am i missing here?

Answer: 
```
Pattern p = Pattern.compile("^(.)\\1*+.$");

```

Match:

```
AF
AAAAAF

```

Don't match:

```
AAAA
AFFFF

```
Pattern: `"^(.)\\1*+.$"`

See [java reference](http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#cg)