-
Notifications
You must be signed in to change notification settings - Fork 94
Issues Using Special Characters in Regex #245
Description
Hi there! I setup searchcode with one of my repos, and have been testing it out. I like it, and I like how easy it is to use, so I want to make it work. I started with some test searches, and was unable to find some strings that I definitely should be able to find using the tool, so I'm wondering if anyone has any ideas of what I need to do in order to make the tool recognize these strings.
First, I was using an API endpoint in this repo that I wanted to find. This is the specific string I was hoping to match:
../../api/studentAdmin/transportation/${personID},${calendarID}
After escaping a bunch of characters, I verified (using regex101.com) that the following regular expression matches the previous string:
/../../api/studentAdmin/transportation/${personID},${calendarID}/
I tried searching this exact term using searchcode, and came up with no results.
I was hoping to find all files containing the increment operator (++). I searched for ++, and found no results. Knowing these are both special characters, I tried escaping them, ++, and still had no results. I also tried double escaping, \+\+, with no results. I tried searching using a regular expression, /\+\+/ and /++/ and still had no results. When I search for ++ in vscode in this repo, I find 37 results, so it's not that the operator is not present in my code.
I also had trouble searching for strings that end with a period, or with a parenthesis, for example, student.instructor. or student.getStudent(
Let me know if anyone has any ideas how I should be searching for strings. Escaping characters does not seem to make any difference, and searching using a regular expression also does not seem to make any difference. I just want to use this tool to find any exact matches to strings that I am searching for, even if they contain special characters. Thank you!