4 ms·
I’m verrrry interested in your regex!! Can you share? I’m interested in building a fitness ontology/terminology linked to a tokenizer and parser.
by fudged71 2y ago
I’m verrrry interested in your regex!! Can you share?
I’m interested in building a fitness ontology/terminology linked to a tokenizer and parser.
- tmpz22 2y agoMy format is MM/DD/YYYY (i.e. 1/1/2025) $sets x $reps $weight $name (i.e. 3x10 135 Bench Press) I uploaded the log file to ChatGPT and had it spit out a Python script to parse into JSON: ``` for line in file: date_match = re.match(r'^(\d{1,2}/\d{1,2}).\*?$', line.strip()) if date_match: # construct a new workout entry # continue exercise_match = re.match(r'^(\d+)x(\d+)\s+(\d+)\s+(.+)$', line.strip()) if exercise_match: # insert new exercise into current workout # continue ```