I would not recommend using a regex for this particular application. Yes, it is possible however norm's suggestion of using indexOf() and lastIndexOf() is more efficient and likely more...