am I regexing by mistake?

David V Glasgow dvglasgow at gmail.com
Sun Sep 2 04:43:52 EDT 2018


For the record, this was my stupidity, nothing to do with escaping wildcards.  Filter lines doesn’t treat a question mark as anything but text.  

The script I posted didn’t find 'asl?’ because I forgot to pre- and post- pend an asterisk before filtering.  So, connected to wildcards, but I was definitely barking up the wrong tree.

Cheers,

David G

> On 31 Aug 2018, at 3:35 pm, Brian Milby via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Need to put question mark in brackets “[?]” when using wildcard filters if you want to match a literal question mark. Otherwise it signifies a single character match to anything.
> 
> Thanks,
> Brian
> On Aug 31, 2018, 9:12 AM -0500, David V Glasgow via use-livecode <use-livecode at lists.runrev.com>, wrote:
>> Hello, folks.
>> 
>> I am undertaking keyword searches of chat logs. The keywords are stored as themed lists in fields.
>> 
>> One of the things I am interested in is finding lines where one contributor asks another about where they live, shop, go to school etc etc. So, (among other phrases) I filter for lines in the text containing the acronym “ asl ” (nowhere are quotes actually included in fields or variables, they’re just in this mail). I pad with spaces so as not to find “asleep”. I also want to find “asl?”
>> 
>> So I repeat through lines of the keyword field “location"
>> 
>> Filter lines of tsource with tpattern
>> 
>> … which works for everything except fails to match “asl?”. It occurred to me that perhaps the question mark is being interpreted as a regex symbol, so I tried changing the line in the field to read “ asl/?”, but that doesn’t find the “asl?” that I can see in the third line of the text to be searched….
>> 
>> 
>> shadownave (09/16/14 1:44:58 AM): hey care to chat
>> shadownave (09/16/14 1:45:09 AM): hey care to chat
>> what_sez_moo (09/16/14 1:45:18 AM): sure asl?
>> what_sez_moo (09/16/14 1:45:52 AM): 13 / F / Ashton here
>> shadownave (09/16/14 1:51:00 AM): 25/m/Derby
>> shadownave (09/16/14 1:51:03 AM): how r u tonight
>> what_sez_moo (09/16/14 1:51:16 AM): bored.
>> 
>> 
>> What am I doing wrong? Is this something to do with regex?
>> 
>> Oh yes, and I thought there might be invisible characters messing things up, so I exported source text as plain text from BBedit, with no improvement.
>> 
>> best wishes
>> 
>> David Glasgow
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list