Author Topic: Change in vim cua regex  (Read 2266 times)

b

  • Senior Community Member
  • Posts: 325
  • Hero Points: 26
Change in vim cua regex
« on: November 19, 2015, 08:37:36 PM »
It appears that in the vim CUA command mode that the regex parser is inconsistent or changed.
(v20.0.0.12/Hotfix 1)

I'm changing a bunch of printf functions to a debug function, but I don't want to change the fprintf routines

I can perform a search as /\<printf and it finds the matches
However, if I try to search and replace, it finds no match  :%s/\<printf/debug/

Yet, :%s/\bprintf/debug/ works (Perl regex).  But if I try searches with the Perl regex /\bprintf does not.

It appears that one is still using the vim regex, and the other is using the perl regex.

Is this a bug or is there some other configuration change I need to make them consistent?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: Change in vim cua regex
« Reply #1 on: November 19, 2015, 10:11:46 PM »
\< is not longer supported. use \o< instead. This change was made to improve compatibility with Perl.

/\bprintf works for me. No change here.

b

  • Senior Community Member
  • Posts: 325
  • Hero Points: 26
Re: Change in vim cua regex
« Reply #2 on: November 21, 2015, 12:50:42 AM »
I'm two for two today.   Now /\b<string> is working where I had tried it several times before and it hadn't.   

Thanks for the alternate.  What is the \o ??  old?


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: Change in vim cua regex
« Reply #3 on: November 21, 2015, 01:06:36 AM »
\o does not stand for old. It stands for option. We simply needed a way to add extensions without conflicting with Perl options or messing up how to fully escape a regex string (can't use \ followed by non-alpha character).