Before a student's question is sent to the external AI provider, StudyBuddy must remove identifiers.
Read questions, one per line, until the end of input. Replace, in this order:
- Chinese resident ID numbers — 17 digits followed by a digit or
X(18 characters, not part of a longer digit run) →[ID_CARD] - email addresses —
name@domain.tldwhere name and domain use letters, digits,.,_,-→[EMAIL] - Chinese mobile numbers —
1followed by a digit3–9and 9 more digits (11 digits, not part of a longer digit run) →[PHONE] - WKU student IDs — exactly 7 digits (not part of a longer digit run) →
[STUDENT_ID]
Output for each line: Q<k>: <redacted text>; if anything was replaced, add (redacted: n) with the number of replacements. A line containing an [ID_CARD] is sensitive: print Q<k>: BLOCKED - remove your ID card number and ask again instead (nothing is sent). At the end: Sent: s, Blocked: b, Redactions: r (r counts redactions in sent lines only).
Input:
Why does my loop never end?
My ID is 1234567 and my email is yuki@wku.edu.cn, why can't I log in?
Call me at 13812345678 about lab 3
My ID card is 33030219990101123X please check my account
Output:
Q1: Why does my loop never end?
Q2: My ID is [STUDENT_ID] and my email is [EMAIL], why can't I log in? (redacted: 2)
Q3: Call me at [PHONE] about lab 3 (redacted: 1)
Q4: BLOCKED - remove your ID card number and ask again
Sent: 3, Blocked: 1, Redactions: 3