Author Topic: Find and Replace dialog box does not show Unix Regular expression under Search  (Read 2411 times)

wbullaughey

  • Community Member
  • Posts: 75
  • Hero Points: 2
I'm sure this worked when I started using the beta but now only SlickEdit, Perl and Wildcards (*,?) are available.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2373
  • Hero Points: 132
Perl replaced Unix, they were largely redundant.

wbullaughey

  • Community Member
  • Posts: 75
  • Hero Points: 2
I would guess many people would find that confusing. I've never used Perl but have used Unix/Linux for a long time. How about something like "Regular expression (Perl/Unix/Linux)" or just (Perl/Unix).

Tim Kemp

  • Senior Community Member
  • Posts: 536
  • Hero Points: 90
I had seen that there was a plan to get rid of the Unix option, but hadn't said anything since it was presented as a fait accompli.

I've always used the Unix format. I've never used Perl and wasn't aware that it was the same as Unix. Since v20, I've been using the SlickEdit format, but it's a pretty large departure and not compatible with anything else as far as I can see.

I guess I'll try the Perl regular expressions and see how different they are from Unix. I don't feel like this was change for the better. I wonder how many other users are feeling like the rug was pulled out from under them.

StephenW

  • Senior Community Member
  • Posts: 189
  • Hero Points: 21
I have just started trying v20 today and it seems that support for Brief regular expressions has also been dropped.  This is going to be a significant pain for me, as I have quite a number of macros using regular expressions, and when I checked them, all the ones I found were using the +B option to use Brief syntax, so it is likely that they will be broken.  Some of these are macros I have been using since the OS/2 version of Slickedit, so I will have to spend quite a bit of time working out just what they used to do and changing them to Perl/Unix format.  And I will have to retrain my fingers to do different regular expressions in the Find and Replace dialogs.  So I am not feeling very happy about the new version.

hs2

  • Senior Community Member
  • Posts: 2737
  • Hero Points: 288
Although I'm still using Brief emulation - of course ;) - I've been using SE regex since a long time. In my opinion the syntax is just pretty good to use and if I remember correctly it's more powerful than Brief regex.
However, I do understand and normally agree that compatibility breaks are a problem.
On the other hand I guess the share of Brief regex users is probably to small to justify the effort and costs of porting it to the new regex engine powering SE in the future and maintaining it.
I hope it's not too hard to convert your macros !
Good luck with that, HS2

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4930
  • Hero Points: 402
Sorry we removed Brief and Unix regular expressions. We try to keep things compatible when it's reasonable. Brief syntax was odd enough that there were actually macro bugs where things weren't escaped correctly and it would have been a mess for us to try to add syntax to provide full syntax of v20 regular expression features. As for Unix regular expressions (a syntax we made up), it's syntax is very close to Perl and users will benefit from the switch since Perl syntax is arguable the most popular syntax.

If you need any help converting your Brief or Unix regular expressions, just post them. Brief regex is quite a bit different than Perl or SlickEdit. As for Unix regular expressions, like Lee said, it's very similar to Perl. Making the switch should be pretty easy. Just make sure you use \R when you want to match whatever the line format is for a particular file and not \n which now means to just match a single 10 character.

Type "help Perl regular expressions" on the SlickEdit command line to get help on Perl regular expressions in the new help system. We tried to improve the on-line help for Perl and SlickEdit regular expressions for v20.

I use SlickEdit syntax because I'm used to it, it is the most compatible with really old versions of SlickEdit, and it has a few advantages over Perl (defaults to minimal matching which helps to avoid buggy regular expressions that are not tested enough, braces for no match group which is easier to read, fewer ambiguities like \1 which can mean multiple things depending on the rest of your regex, [] is a valid empty character match set). Arguably it's few advantages are negated by the fact the Perl regular expressions are the most popular.

StephenW

  • Senior Community Member
  • Posts: 189
  • Hero Points: 21
I would have been happy if you had just left the Brief regular expressions as they were and told us that they were deprecated and would not be getting any updates (or perhaps even no support).  That way, it would not have broken existing macros and I could just take my time converting over to Perl format.  I was actually expecting that to happen a long time ago, and was surprised when you added new regular expression features some time back that you also added them in Brief format.  I do use Perl format in Linux and egrep at times, but I always need to use the documentation.  It is not a bad thing to have to use Perl format for new macros, but I really do not like having my old ones broken.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4930
  • Hero Points: 402
It wasn't as simple as leaving what code was there. We didn't enhance the existing code we had. The old regex engine was completely thrown out and we started over. This had to be done. In order to keep Brief regular expressions, we would have had to write new code for handling Brief regular expressions. Even still, we don't like removing features or breaking compatibility. It ends up being a pain for someone. Sorry.