SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: outsider on September 10, 2011, 07:07:37 pm

Title: Searching for substrings
Post by: outsider 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
Title: Re: Searching for substrings
Post by: LBCEi 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
Title: Re: Searching for substrings
Post by: outsider 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.
Title: Re: Searching for substrings
Post by: Graeme on September 10, 2011, 09:25:20 pm
Try the pos function.
Title: Re: Searching for substrings
Post by: outsider on September 12, 2011, 02:56:40 pm
Code: [Select]
Try the pos function.
Perfect! Thanks once again Graeme.