In vimscript, when using search() function, why doesn't this regex "^func Test\\w\+(t…
- User
In vimscript, when using search() function, why doesn't this regex "^func Test\w+(t \*testing.T)" match
func TestSomething(t *testing.T) {
- Assistant
The regex pattern
^func Test\\w\+(t \\*testing\.T)is intended to match strings like , but it doesn't match in its current form due to a few issues with escaping and pattern structure. Here's a breakdown: - User
Now I changed it to "^func Test\w\+(t \*testing\.T)", but it matches func TestSomething() { as well
- Assistant
The regex pattern
^func Test\\w\\+(t \\*testing\\.T)is still not working as desired because of how it's structured. The pattern needs further refinement to ensure it matches only the desired function signatures.Here’s a potential fix:
- User
Ok, now it's ^func Test\w+(t *testing.T) and it's not matching anything
- Assistant