I am on a health kick and weight loss program. Every day I am sending my daily log to a coach to help motivate and advise. I figured this would be good to try and automate as some things will be already present from teh previous day and others I enter in.
I am trying to scrape the previous day’s log to get things like yesterdays weight, todays day number etc but seem to be having some trouble getting it out. I thought that the shortcut “Match Text” would do a RegExp, and as such I thought I could get data out of it. For example from this text:
I thought I could get the day number to increment. But when I use the “Match Text” operation it will return the entire match including what I put in. For example I am putting in
*Cycle: (\d)
And I would like to just get the number 1 as I thought the parentheses would tell it to return that portion, but it returns “*Cycle: 1”.
How can I search text but return just what I want? Do I need to search again in the results? Or can I do it in one step?
I think if you add the action “Get Group from Matched Text” after your ‘Match Text” action that will achieve what you want. At least, it worked in my quick test. It’s still another action but at least you don’t need another Regex.
Now can you help me with the RegExp and match start of line? I though that the ^ would match start of line, so “^*Cycle: (\d)” would give me what I want, but when I do that it returns nothing. Matching “*Cycle: (\d)” works ok so it seems to be an issue matching start of line. Any thoughts??