Author Topic: Searching for substrings  (Read 2840 times)

outsider

  • Community Member
  • Posts: 64
  • Hero Points: 1
Searching for substrings
« on: September 10, 2011, 07:07:37 pm »
Hi guys,

I can't find it if it exists, but is there a SlickEdit function for searching for a substring within a string (preferably one with regex)? All the functions I've found so far regarding search pertain to the whole of the current or named buffers, either explicitly or implicitly.

thanks

LBCEi

  • Senior Community Member
  • Posts: 200
  • Hero Points: 20
Re: Searching for substrings
« Reply #1 on: September 10, 2011, 07:18:36 pm »
You can search within a selection.  So, unless I misunderstand your question, just select the string within which you wish to search, Ctrl-F, enter your desired search regex and you get what you want. 

Since you use the word "function", perhaps you are looking for a way to do this in a Slick-C macro?  In which case you should post this question in the Slick-C macro programming forum.

Good Luck

outsider

  • Community Member
  • Posts: 64
  • Hero Points: 1
Re: Searching for substrings
« Reply #2 on: September 10, 2011, 09:19:16 pm »
Yes LBCEi, I'm looking for a Slick-C function which will accept the string to search as an argument. Don't know how to move the post so maybe I'll repost there.

Thanks for responding.

Graeme

  • Senior Community Member
  • Posts: 2480
  • Hero Points: 325
Re: Searching for substrings
« Reply #3 on: September 10, 2011, 09:25:20 pm »
Try the pos function.

outsider

  • Community Member
  • Posts: 64
  • Hero Points: 1
Re: Searching for substrings
« Reply #4 on: September 12, 2011, 02:56:40 pm »
Code: [Select]
Try the pos function.
Perfect! Thanks once again Graeme.