+5  A: 

Edit : this answer referred to OP's first question, and it actually still answers is second :-p
Use boundaries, such as \b. \bwent\b would match went.

Vincent Savard
A: 

This would match all capitalised words:

/\b([A-Z][a-z]+)\b/

Or just the word 'Dublin':

/\bDublin\b/
Ashley Williams
good thinking but that's going to match Ireland too wouldn't it?
James Eggers
Oh, you just want to match *'Dublin'*? Sorry, I thought that was just an example; this will work: /\bDublin\b/
Ashley Williams
A: 

In some languages you can use () to specify a selection and then reference the first selection with $1 or 1.

vurte
I'm using python, any ideas?
James Eggers
Sorry this was the wrong answer. Your question has changed...
vurte
In this case you can use /Dublin[^[:alpha:]]/
vurte
A: 

This should match ever instance of Dublin in your sample, but you will have to look at the match groups because it would also capture the I in DublinIreland.

/(\bDublin)(\b|[A-Z])/g
mikerobi