 	'<div class="workout-header">' +
 		toHtml(this._text) +
 	'</div>'
+
+WorkoutHeader.getMeta = (text) ->
+	text.match(/\(([^\)]*)\)/)?[1]
 
 Exercises = (exercises) -> this
 

	'</div>'

WorkoutHeader = (headerText) ->
	DATE_REGEXP = /(\d+\/\d+\/\d+)\s/
	this._text = headerText
	this._workoutDate = headerText.match(DATE_REGEXP)?[1]
	this

WorkoutHeader.prototype.isValid = () ->

		text.join '<br>'
	else
		text.replace(/\n/g, '<br>')

chop = (text, textToChop) ->
	if typeof text is not 'string'
		text
	else
		text.replace(textToChop, '')

# Takes in text containing slash separated date e.g. 2015/03/01
# returns first date found as unix time
# returns null if no date found
# TODO: adjust for timezones
getDate = (text, context) ->
	WORKOUT_HEADER_DATE_REGEXP = /(\d+\/\d+\/\d+)\s/
	dateString = text.match(WORKOUT_HEADER_DATE_REGEXP)?[1]
	if !dateString
		null
	else
		dateString.replace(/\//g, '-')
		Date.parse(dateString)

# Takes in text containing unit of weight
# returns first unit of weight found
# returns user's default unit of weight if no date found
getUnitOfWeight = (text, context) ->
	if (text.contains('lbs') or text.contains('lb'))
		cfg.unitOfWeight.pounds
	else if (text.contains('kgs') or text.contains('kg'))
		cfg.unitOfWeight.kilos
	else
		cfg.unitOfWeight.DEFAULT

Workouts = (text) ->
	this._chunks = text.split(WORKOUT_SEPARATOR)
