Re: Regex (matchChunk) help...

2018-06-15 Thread Mike Bonner via use-livecode
Hey cool! I'd use Jims (an marks) method. MUCH simpler. On Fri, Jun 15, 2018 at 7:06 PM Jim Lambert via use-livecode < use-livecode@lists.runrev.com> wrote: > Building on what Mark Wieder elegantly wrote: > > > MarkW wrote: > > > > filter lotsOfText with "*selkirkst*skyrider1*” > > function e

Re: Regex (matchChunk) help...

2018-06-15 Thread Jim Lambert via use-livecode
Building on what Mark Wieder elegantly wrote: > MarkW wrote: > > filter lotsOfText with "*selkirkst*skyrider1*” function extractStrings lotsOfText, startWord, endWord replace cr with space in lotsOfText -- Makes sure lotsOfText is just a single line replace startWord with cr

Re: Regex (matchChunk) help...

2018-06-15 Thread Bob Sneidar via use-livecode
If the first search string can be anywhere before the second search string, and the second search string can be anywhere (or nowhere) after the first string, use LIKE '%selkirkst%' OR LIKE '%skyrider1%' I posted some code, and also a sample stack, for converting an array to a memory database an

Re: Regex (matchChunk) help...

2018-06-15 Thread Bob Sneidar via use-livecode
I understood he wants lines with either or. Bob S > On Jun 15, 2018, at 10:05 , Mark Wieder via use-livecode > wrote: > > On 06/15/2018 08:45 AM, Glen Bojsza via use-livecode wrote: >> Any suggestions? > > filter lotsOfText with "*selkirkst*skyrider1*" > > -- > Mark Wieder > ahsoftw...@gm

Re: Regex (matchChunk) help...

2018-06-15 Thread Mike Bonner via use-livecode
Glad it worked. If it turns out there is a reason not to use trueword and a for each loop, the same basic algorithm can be used with offset() but it would be a bit more convoluted. Basically, find the first offset for the beginning string, then use that to skip chars to look for both the beginnin

Re: Regex (matchChunk) help...

2018-06-15 Thread Glen Bojsza via use-livecode
Hi Mike, Yes this worksnever used or knew about trueword. thanks! Glen On Fri, Jun 15, 2018 at 1:21 PM, Mike Bonner via use-livecode < use-livecode@lists.runrev.com> wrote: > Try this.. > > on mouseup >local tCharOffset >--set the text of field 1 to the text of field 1 >put the

Re: Regex (matchChunk) help...

2018-06-15 Thread Mike Bonner via use-livecode
Slightly cleaned up, and adjusted to empty tPair after a match. (on the off chance there is a second ending without a matching new beginning word) > on mouseup >put the text of field 1 into tText >put "beginning" into tstartword -- string begin >put "ending" into tEndword -- string

Re: Regex (matchChunk) help...

2018-06-15 Thread Mike Bonner via use-livecode
Try this.. on mouseup local tCharOffset --set the text of field 1 to the text of field 1 put the text of field 1 into tText put "beginning" into tstartword -- string begin put "ending" into tEndword -- string end put 1 into tCounter -- tracks current word repeat for each truew

Re: Regex (matchChunk) help...

2018-06-15 Thread Mark Wieder via use-livecode
On 06/15/2018 08:45 AM, Glen Bojsza via use-livecode wrote: Any suggestions? filter lotsOfText with "*selkirkst*skyrider1*" -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to su

Re: Regex (matchChunk) help...

2018-06-15 Thread Glen Bojsza via use-livecode
Mike, I believe that you are correct in understanding what I am trying to extract. I will need a bit more time to work through your solution. regards, Glen ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe,

Re: Regex (matchChunk) help...

2018-06-15 Thread Glen Bojsza via use-livecode
Hi Jerry, I may be wrong but it looks like your solution assumes that the line has the beginning and ending I am looking for in the first and last positions...in my example text that I gave it was all one line and the string I am looking for is somewhere in the middle. I may not have been clear bu

Re: Regex (matchChunk) help...

2018-06-15 Thread Glen Bojsza via use-livecode
Bob, this is an interesting approach using SQL. I will try and setup a simple test with SQLite. thanks On Fri, Jun 15, 2018 at 11:53 AM, Bob Sneidar via use-livecode < use-livecode@lists.runrev.com> wrote: > one way would be to populate a memory database, then query it with LIKE: > > SELECT * FR

Re: Regex (matchChunk) help...

2018-06-15 Thread Brian Milby via use-livecode
I’m a little confused about the requirements. Can the desired text span lines? If not, it changes things slightly. Offset is something you can use. Find location of end token. Find location of first start token. Find location of next start token. If before end token, try again until after or no

Re: Regex (matchChunk) help...

2018-06-15 Thread Mike Bonner via use-livecode
If I understand correctly.. If you find the beginning string occurrence, and then find another beginning string, you want to ignore the first, and only take strings where beginning and end have no intermediate beginnings? Like this I mean.. beginning blah blah blah blah blah *beginning blah blah b

Re: Regex (matchChunk) help...

2018-06-15 Thread Jerry Jensen via use-livecode
Will this do what you want? (untested) put empty into tExtract repeat for each line L in bigText if char -9 to -1 of L is “skyrider1” then if char 1 to 9 of L is “selkirkst” then put L & return after tExtract end if end if end repeat if char -1 of tExtract is return then delete c

Re: Regex (matchChunk) help...

2018-06-15 Thread Bob Sneidar via use-livecode
one way would be to populate a memory database, then query it with LIKE: SELECT * FROM memorydb WHERE stringtext LIKE 'selkirkst%' OR stringtext LIKE '%skyrider1' If you need lines that have both use a single comparison 'selkirkst%skyrider1' Sometimes SQL is the best way to find things. Bob S

Regex (matchChunk) help...

2018-06-15 Thread Glen Bojsza via use-livecode
Hello, I have a couple of hundred pages of text where I need to extract out a different string. The ending of each string I need has the same endingskyrider1 The beginning of each string is the same selkirkst The middle of each string can be any text. The problem is that within each line