modify_tag: Modify Task Tag(s)

View source: R/update.R

modify_tagR Documentation

Modify Task Tag(s)

Description

This is a package internal function to modify tags of a task (in the todo.txt definition properties prefixed with + or @).

Note that by suitably setting the old and new value, specific effects like removing a tag or adding an additional tag. For instance, by setting the old value to the end-of-line regular expression $, a tag can be appended. Note that this may result in adding superfluous spaces.

Usage

modify_tag(task, old, new)

Arguments

task

A string with one (or, as vector, one or more) task(s) that follow(s) the todo.txt specification by Gina Trapani. When multiple tasks are provided, all tasks are modified in the same way.

old

Old tag to find and replace (a string).

new

New tag to replace the old value with. Note, could be multiple new tags chained together +new1 +new2 (a single string).

Value

the updated task(s)

Author(s)

Paul Lemmens (paul.lemmens@gmail.com)


paullemmens/todoRtxt documentation built on May 19, 2023, 3:21 p.m.