79705882

Date: 2025-07-18 08:27:27
Score: 2
Natty:
Report link

Input

text = c('Current year is 2025', 'Current year is 2025') 
mon  = c('06', '12')

Please give an example of the full input structure.

Approach

We can develope something robust from

s = format(as.Date(sprintf('%s-%s-01', sub('\\D+', '', text), mon))+31, '%Y %b') 

Does text always contain a four-digit representation of a year? No more numbers?

Output

> s
[1] "2025 Jul" "2026 Jan"
Reasons:
  • RegEx Blacklisted phrase (2.5): Please give
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-2):
Posted by: Friede