Escaping the Filter command's wildcards

Mark Schonewille m.schonewille at economy-x-talk.com
Wed May 22 20:32:42 EDT 2013


Hi Paul,

I see what you mean. You weren't looking for a solution, just for more 
trouble :-)

I tried several special characters and they can all be used to filter 
lines with the same workaround. Unfortunately, many of those special 
characters have no effect, because regex isn't fully supported by the 
filter command, as Pete mentioned already. Therefore I wonder why we 
need to escape the question mark. That seems inconsistent to me.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other 
colour spaces. http://www.color-converter.com

Buy my new book "Programming LiveCode for the Real Beginner" 
http://qery.us/3fi

On 5/23/2013 01:26, Paul Dupuis wrote:
> On 5/22/2013 5:37 PM, Mark Schonewille wrote:
>> Hi Paul,
>>
>> This works fine for me:
>>
>> put replacetext("xxx?!xxx","[\?!]","")
>> --> xxxxxx
>>
>> What exactly is the problem you're having? Could you post some of the
>> code that doesn't work for you?
>
> it is with the filter command not the replaceText function I ran into a
> problem:
>
> If you have a variable tSource with following 3 lines:
>
> sometext?
> sometext!
> sometext.
>
> and filter tSource with "sometext?" you get all 3 lines instead of just
> the one with the ? at the end.
>
> filter tSource with "sometext[?]" filters to just the expected line, so
> that is a work-around to solve what I needed to do.
>
> I was surprised that filter tSource with "sometext\?" did NOT work
> (since that would have been a valid regex pattern to filter to just the
> line with the ?). However the experience made me curious as to what
> other inconsistencies with the filter command folks may have uncovered.
>
> _______________________________________________
> 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