extr_post_category: Extract post category from title

Description Usage Arguments Details Value

View source: R/ptt-manipulate.R

Description

extr_post_category returns the category of a PTT post title.

Usage

1
extr_post_category(post_title)

Arguments

post_title

Character. UTF-8 encoding and no leading space in string.

Details

This function extracts the category from the title based on regular expressions. It extracts the content inside the square brackets ([, ]) of the title. If there is no square bracket, it searches for Re: and extracts this pattern. If neither is matched, the function returns string No.

Value

If there is square-bracket-match or Re:-match, the function returns a string. Else, the function returns string No.


liao961120/pttR documentation built on Dec. 16, 2019, 2:19 a.m.