Exercise 3: A Workspace-Wide Regex Replace — Possible Solution ==================================================================== EXAMPLE SCENARIO ------------------------------ A folder containing several files with lines like: console.log("Starting process") console.log("Done") and the goal is to convert every console.log(...) call to logger.debug(...), keeping whatever was originally inside the parentheses — exactly the chapter's own example. STEPS ------------------------------ 1. Press Ctrl+Shift+F to open workspace-wide search. 2. Click the ".*" icon in the search box to enable regex mode. 3. In the search field, enter: console\.log\((.*)\) The backslashes escape the literal parentheses and period (regex metacharacters, per the site's own regex1 course), and (.*) captures whatever was inside the original parentheses as group 1. 4. Click the arrow/chevron to reveal the replace field, and enter: logger.debug($1) $1 refers back to whatever (.*) captured. 5. BEFORE clicking "Replace All" — per this chapter's own warn-box — expand the results list and review every matched line across every file, confirming each one is actually a console.log call that should change, and toggle off any match that shouldn't be included. 6. Once reviewed, click "Replace All" to apply the change across every file at once. RESULT ------------------------------ logger.debug("Starting process") logger.debug("Done") WHY THIS WORKS AS AN ANSWER ------------------------------ This exercise reuses the chapter's own worked regex example exactly — console\.log\((.*)\) as the search pattern and logger.debug($1) as the replacement — but treats it as something to actually RUN across a real multi-file folder via Ctrl+Shift+F, rather than just reading the example. Deliberately reviewing the results before confirming "Replace All" directly applies this chapter's own warn-box guidance: a pattern like (.*) is intentionally greedy and could match more than intended in an unusual line (for example, a line with two console.log calls on it, or a commented-out example), so checking the actual matched lines first — rather than trusting the pattern blindly — is the responsible way to run a workspace-wide regex replace.