python / cpython

The Python programming language
https://www.python.org
Other
62.47k stars 29.99k forks source link

IDLE: document search (find) and replace better #89362

Open terryjreedy opened 3 years ago

terryjreedy commented 3 years ago
BPO 45199
Nosy @terryjreedy

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields: ```python assignee = 'https://github.com/terryjreedy' closed_at = None created_at = labels = ['expert-IDLE', 'type-feature', '3.11'] title = 'IDLE: document search (find) and replace better' updated_at = user = 'https://github.com/terryjreedy' ``` bugs.python.org fields: ```python activity = actor = 'terry.reedy' assignee = 'terry.reedy' closed = False closed_date = None closer = None components = ['IDLE'] creation = creator = 'terry.reedy' dependencies = [] files = [] hgrepos = [] issue_num = 45199 keywords = [] message_count = 1.0 messages = ['401801'] nosy_count = 1.0 nosy_names = ['terry.reedy'] pr_nums = [] priority = 'normal' resolution = None stage = 'needs patch' status = 'open' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue45199' versions = ['Python 3.11'] ```

terryjreedy commented 3 years ago

The doc currently just says that the Search, File Search, and Search&Replace dialogs exist for the corresponding menu entries. Add a short section in "Editing and navigation" to say more.

  1. Any selection becomes search target, except that S&R is buggy.
  2. Search is only within lines. .* and \n do not match \n even with RE.
  3. [x]RE uses Python re module, not tcl re. It applies to replace also. So if target RE has capture groups, \1 (and \gname? test) in replacement works.(match.expand(repl))
  4. Refer to re chapter and RegularExpression HOWTO.