Code Search with Regular Expressions

Problem description

Code Search feature limitation

Expected behavior

I tried using the regex pattern "(\w+)":\s*(\[[^\[\]]*\]) to capture information in a data file of my project but it did not work. It does work in my project but is having issues capturing everything I get when regex101: build, test, and debug regex tool and using the data.json file content.

Actual behavior

After regressing it a bit I was able to get the first part of "([a-zA-Z0-9])+":[ \t\n]+ to work in the Code Search feature proving that it is capturing with regex patterns. It stops capturing when I add \[. My hope is the Code Search would use the same engine as the browser (JS).

Steps to reproduce

In https://replit.com/@scotttrider/ClearcutSophisticatedLoopfusion
Add Code Search window to project
Toggle regular expression button on
Paste in "([a-zA-Z0-9])+":[ \t\n]+ into the search window
Press enter
Paste in "([a-zA-Z0-9])+":[ \t\n]+\[ into the search window
Press enter
Compare results.

Browser

Edge and Chrome

OS

Windows 10

Device if mobile

N/A

Plan

free tier

Welcome to ask @scotttrider!

Replit Code Search does not work with RegEx expressions. If you want it to, please change this topic’s category to Feature Requests.

3 Likes

‘Replit Code Search does not work with RegEx…’ I am finding it does, but not to the extent of helping me debug my code. And it has an option toggle for it. ? The Feature Request was my first choice but after nudging it a bit, I was able to list the reproduce steps.

I have changed this to the Feature Request section, per instructed. :slight_smile:

I’m pretty sure it does work with regex? I could have sworn there is a toggle for it.

Yes, there is a regex toggle.

3 Likes