Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Regexp subexpression replacement doesn't work, throws exception #5275

Closed
njx opened this issue Sep 20, 2013 · 3 comments
Closed

Regexp subexpression replacement doesn't work, throws exception #5275

njx opened this issue Sep 20, 2013 · 3 comments
Assignees

Comments

@njx
Copy link
Contributor

njx commented Sep 20, 2013

  1. In Getting Started, Edit > Replace
  2. Enter /<([^>]+)>/ as the query and hit enter
  3. Replace with [$1]
  4. Click Yes

Result: Find bar disappears and there's an exception in the console.
Expected: Either we should properly handle the subexpression substitution, or we should just replace with "$1" and continue.

@njx
Copy link
Contributor Author

njx commented Sep 20, 2013

It looks like there's code in FindReplace to deal with regexp subexpression substitutions, but the match data from the regexp doesn't get properly passed to it (in either the single-replace or replace-all cases). Seems like it shouldn't be that hard to hook it up, but either way we shouldn't be silently failing.

@njx
Copy link
Contributor Author

njx commented Sep 20, 2013

BTW, this isn't a recent regression--it doesn't work as far back as Sprint 25. Perhaps it never worked.

@peterflynn
Copy link
Member

Reviewed. Assigned @njx to review potential fix in PR #5295.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants