Simplified version using regex