Skip to content

Error on non-regex search for invalid regex string #11516

@sleepinggenius2

Description

@sleepinggenius2

NetBox version

v3.4.2

Python version

3.8

Steps to Reproduce

  1. Create a Site with Name = "Foo (Bar)" and Slug = "foo-bar"
  2. Perform a default global search or explicit Partial match search for the string "(Bar"
  3. Receive error

Expected Behavior

The Site should have been found and the string appropriately highlighted in the result. I believe this is caused by the use of re.split in utilities.utils.highlight_string, as I could not find where the highlight string is being escaped for non-regex searches.

Observed Behavior

The following error is received:

<class 're.error'>

missing ), unterminated subpattern at position 0

Python version: 3.8.10
NetBox version: 3.4.2

Metadata

Metadata

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions