Skip to content

Unable to use backslash in the replacement value of dictionaries #14556

@CyrilleB79

Description

@CyrilleB79

Context

Issue found while while reviewing the list of modified files in SVN update status window.

Steps to reproduce:

  • Open a new entry in the temporary dictionary
  • Ine pattern field put "p:\a\very\long\path\to\my\project\root\folder\"
  • In replace field, put: "root\"
  • Leave other fields as they are, specifically leave the radio button type on "Anywhere"
  • Press OK

Actual behavior:

I get the following error message box:

Regular Expression error: "bad escape (end of pattern) at position 4".

Expected behavior:

  • When regular expression is not selected as entry type, I should be able to use backslash character normally in the dictionary replace field.
  • I should not get any message related to regexps if I have not selected "Regular expression" as dictionary entry type.

NVDA logs, crash dumps and other attachments:

Following debugWarning found in the log:

DEBUGWARNING - gui.speechDict.DictionaryEntryDialog.onOk (17:27:09.948) - MainThread (19688):
Could not add dictionary entry due to (regex error) : bad escape (end of pattern) at position 4

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

2022.4

Windows version:

Windows 10 20H2 (AMD64) build 19042.2364

Name and version of other software in use when reproducing the issue:

N/A

Other information about your system:

N/A

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

Not tested but surely not new.

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Not tested;unrelated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    p4https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#prioritytriagedHas been triaged, issue is waiting for implementation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions