Re: lineOffset wildcard

2021-04-19 Thread Mark Wieder via use-livecode



I'll try benchmarking this against Jacque's suggestion of matchChunk. 
Filter is normally pretty fast, but I'll have to use the regex version, 
and I'm not sure what the speed implications will be.


Benchmark result averages over 10 runs on a 2700-line script:

filter lines of script 2612.6ms
filter script  2572.1ms
matchChunk 2424.3ms

the code:

put "^local.*"&".*" into tRegexString

put matchChunk(tScript, tRegexString, tStartPos, tEndPos) into tFound?
if tFound? then
   put the number of lines in char 1 to tStartPos of tScript into tLine
end if

filter tScript with regex tRegexString into tFoundScript
# alternate: no appreciable difference in timing
# filter tScript with "local*"&"*" into tFoundScript
if tFoundScript is not empty then
   put lineoffset(tFoundScript, tScript) into tLine
end if

So matchChunk plus "the number of lines" is faster by ~150 milliseconds 
over 2700 lines of text than filter plus lineOffset.


--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: lineOffset wildcard

2021-04-19 Thread Mark Wieder via use-livecode

On 4/19/21 1:02 PM, Ken Ray wrote:
On Apr 19, 2021, at 1:47 PM, Mark Wieder via use-livecode 
mailto:use-livecode@lists.runrev.com>> 
wrote:


On 4/19/21 11:04 AM, J. Landman Gay via use-livecode wrote:

I don't think lineoffset supports wildcards, but you could do it with 
matchChunk.


Ah! matchChunk and the the number of lines of... etc...
That should do it.


Another way to do it is to use 'filter' to get the text of the line that 
matches your wildcard, and then 'lineOffset' to find that line:


put tScript into tTemp
filter tTemp with ("local*" & tFunctionName & "*")
put lineOffset((cr & tTemp & cr),(cr & tScript & cr)) into tPos

Not sure if 'filter' is faster than 'matchChunk' when dealing with large 
scripts, but I have a feeling it might be...


Thanks, Ken.
I'll try benchmarking this against Jacque's suggestion of matchChunk. 
Filter is normally pretty fast, but I'll have to use the regex version, 
and I'm not sure what the speed implications will be.



--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: lineOffset wildcard

2021-04-19 Thread Mark Wieder via use-livecode

On 4/19/21 3:02 PM, Bob Sneidar via use-livecode wrote:

IOC I guess I did misunderstand after all.


Nah... I should have worded it differently to start with.


--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: lineOffset wildcard

2021-04-19 Thread Bob Sneidar via use-livecode
IOC I guess I did misunderstand after all.

Bob S


On Apr 19, 2021, at 12:32 PM, Mark Wieder via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

On 4/19/21 12:11 PM, Bob Sneidar via use-livecode wrote:
Someone needs to update the dictionary then.
wholeMatches
Syntax
set the wholeMatches to {true | false}
Summary
Specifies whether the lineOffset, wordOffset, and itemOffset functions search 
only for entire lines, words, or items.

Here's what I meant:

setting the wholeMatches to true will match the input string verbatim, without 
regard to wildcards. So

lineOffset("local tFunction", ttext) will only match
local tFunction
and
lineOffset("local*tFunction", tText) will only match
local*tFunction
not
local tFunction
and not
local someThing, tFunction, somethingElse

--
Mark Wieder
ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: lineOffset wildcard

2021-04-19 Thread Ken Ray via use-livecode
> On Apr 19, 2021, at 1:47 PM, Mark Wieder via use-livecode 
>  wrote:
> 
> On 4/19/21 11:04 AM, J. Landman Gay via use-livecode wrote:
> 
>> I don't think lineoffset supports wildcards, but you could do it with 
>> matchChunk.
> 
> Ah! matchChunk and the the number of lines of... etc...
> That should do it.

Another way to do it is to use 'filter' to get the text of the line that 
matches your wildcard, and then 'lineOffset' to find that line:

put tScript into tTemp
filter tTemp with ("local*" & tFunctionName & "*")
put lineOffset((cr & tTemp & cr),(cr & tScript & cr)) into tPos

Not sure if 'filter' is faster than 'matchChunk' when dealing with large 
scripts, but I have a feeling it might be...


Ken Ray
Sons of Thunder Software, Inc.
Email: k...@sonsothunder.com
Website: https://www.sonsothunder.com




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: lineOffset wildcard

2021-04-19 Thread Mark Wieder via use-livecode

On 4/19/21 12:11 PM, Bob Sneidar via use-livecode wrote:

Someone needs to update the dictionary then.

wholeMatches

Syntax
set the wholeMatches to {true | false}

Summary
Specifies whether the lineOffset, wordOffset, and itemOffset functions search 
only for entire lines, words, or items.


Here's what I meant:

setting the wholeMatches to true will match the input string verbatim, 
without regard to wildcards. So


lineOffset("local tFunction", ttext) will only match
local tFunction
and
lineOffset("local*tFunction", tText) will only match
local*tFunction
not
local tFunction
and not
local someThing, tFunction, somethingElse

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: lineOffset wildcard

2021-04-19 Thread Bob Sneidar via use-livecode
Someone needs to update the dictionary then. 

wholeMatches

Syntax
set the wholeMatches to {true | false}

Summary
Specifies whether the lineOffset, wordOffset, and itemOffset functions search 
only for entire lines, words, or items.

Bob S

> On Apr 19, 2021, at 11:49 , Mark Wieder via use-livecode 
>  wrote:
> 
> On 4/19/21 11:13 AM, Bob Sneidar via use-livecode wrote:
>> Why even embed the function?
>> put "local" & tString & functionName() into tSearchString
>> set wholeMatches to true
>> put lineOffset(tSearchString) into tLine
>> Or am I misunderstanding the problem (again)? :-)
> 
> Been there.
> the wholematches doesn't affect the offset functions.
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: lineOffset wildcard

2021-04-19 Thread Mark Wieder via use-livecode

On 4/19/21 11:13 AM, Bob Sneidar via use-livecode wrote:

Why even embed the function?

put "local" & tString & functionName() into tSearchString
set wholeMatches to true
put lineOffset(tSearchString) into tLine

Or am I misunderstanding the problem (again)? :-)


Been there.
the wholematches doesn't affect the offset functions.

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: lineOffset wildcard

2021-04-19 Thread Mark Wieder via use-livecode

On 4/19/21 11:04 AM, J. Landman Gay via use-livecode wrote:

I don't think lineoffset supports wildcards, but you could do it with 
matchChunk.




Ah! matchChunk and the the number of lines of... etc...
That should do it.

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: lineOffset wildcard

2021-04-19 Thread Bob Sneidar via use-livecode
Why even embed the function? 

put "local" & tString & functionName() into tSearchString
set wholeMatches to true
put lineOffset(tSearchString) into tLine

Or am I misunderstanding the problem (again)? :-)

Bob S


> On Apr 19, 2021, at 11:04 , J. Landman Gay via use-livecode 
>  wrote:
> 
> On 4/19/21 11:29 AM, Mark Wieder via use-livecode wrote:
>> I'm sure I'm missing something simple here but...
>> I need to use a wildcard in the lineOffset function but I can't seem to find 
>> the correct invocation.
>> put lineoffset("local*", tScript) into tPos
>> always returns zero
>> put lineoffset(tFunctionName, tScript) into tPos
>> of course returns a line number, but possibly not the right one
>> put lineoffset("local"&, tScript) into tPos
>> gives me the correct line in some cases but fails for
>> local tSomeFunction,tOtherFunction
>> Can anyone give me the correct syntax for using a wildcard string as an 
>> argument to lineOffset? Thanks in advance - I've spent enough time on my own 
>> trying to figger this out.
> 
> I don't think lineoffset supports wildcards, but you could do it with 
> matchChunk.
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: lineOffset wildcard

2021-04-19 Thread J. Landman Gay via use-livecode

On 4/19/21 11:29 AM, Mark Wieder via use-livecode wrote:

I'm sure I'm missing something simple here but...

I need to use a wildcard in the lineOffset function but I can't seem to find the correct 
invocation.


put lineoffset("local*", tScript) into tPos
always returns zero

put lineoffset(tFunctionName, tScript) into tPos
of course returns a line number, but possibly not the right one

put lineoffset("local"&, tScript) into tPos
gives me the correct line in some cases but fails for
local tSomeFunction,tOtherFunction

Can anyone give me the correct syntax for using a wildcard string as an argument to lineOffset? 
Thanks in advance - I've spent enough time on my own trying to figger this out.




I don't think lineoffset supports wildcards, but you could do it with 
matchChunk.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: lineOffset wildcard

2021-04-19 Thread Bob Sneidar via use-livecode
I think either matchText, or else wholematches used with some form of xOffset 
is what you want. 

Bob S


> On Apr 19, 2021, at 09:29 , Mark Wieder via use-livecode 
>  wrote:
> 
> I'm sure I'm missing something simple here but...
> 
> I need to use a wildcard in the lineOffset function but I can't seem to find 
> the correct invocation.
> 
> put lineoffset("local*", tScript) into tPos
> always returns zero
> 
> put lineoffset(tFunctionName, tScript) into tPos
> of course returns a line number, but possibly not the right one
> 
> put lineoffset("local"&, tScript) into tPos
> gives me the correct line in some cases but fails for
> local tSomeFunction,tOtherFunction
> 
> Can anyone give me the correct syntax for using a wildcard string as an 
> argument to lineOffset? Thanks in advance - I've spent enough time on my own 
> trying to figger this out.
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.com
> 
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


lineOffset wildcard

2021-04-19 Thread Mark Wieder via use-livecode

I'm sure I'm missing something simple here but...

I need to use a wildcard in the lineOffset function but I can't seem to 
find the correct invocation.


put lineoffset("local*", tScript) into tPos
always returns zero

put lineoffset(tFunctionName, tScript) into tPos
of course returns a line number, but possibly not the right one

put lineoffset("local"&, tScript) into tPos
gives me the correct line in some cases but fails for
local tSomeFunction,tOtherFunction

Can anyone give me the correct syntax for using a wildcard string as an 
argument to lineOffset? Thanks in advance - I've spent enough time on my 
own trying to figger this out.


--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to escape wildcard chars - and find the offset of a '?' in a URL?

2021-03-14 Thread BT via use-livecode
Solved! Thanks for responding & testing this Håkan.

I'm glad to hear that the ‘?’ is a regular character in this context and it’s 
the usual 'pilot error’! Tracing backwards I spotted a stray extra quote in the 
line defining tURL, which wasn’t rejected on save. 

I’ll be glad when I can get back to a colour IDE - it’s so hard to spot syntax 
errors in the monochrome script editor I see with 9.6.1 on Big Sur.  

Cheers,
Keith

> On 14 Mar 2021, at 16:36, ha...@exformedia.se wrote:
> 
> Hmm, strange! For me it works without problems:
> 
> put "https://www.mysite.com/?some=parameters=folllow; into tURL
> put offset("?", tURL)
> 
> Returns 24
> 
> :-Håkan
> On 14 Mar 2021, 17:29 +0100, BT via use-livecode 
> , wrote:
>> Hi folks,
>> What’s the correct the syntax needed to escape a question mark so that its 
>> offset can be found in a URL string?
>> 
>> I get zero returned by put offset(“?”, tURL) and put offset( "?\",tURL) and 
>> put offset( numToCodepoint(Ux003F),tURL) throws errors.
>> 
>> The docs & forums cover escaping quotes but not wildcard characters.
>> 
>> Thanks in advance for any steer.
>> Best,
>> Keith
>> ___
>> use-livecode mailing list
>> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to escape wildcard chars - and find the offset of a '?' in a URL?

2021-03-14 Thread Mark Wieder via use-livecode

On 3/14/21 9:27 AM, BT via use-livecode wrote:

Hi folks,
What’s the correct the syntax needed to escape a question mark so that its 
offset can be found in a URL string?

I get zero returned by put offset(“?”, tURL) and put offset( "?\",tURL) and put 
offset( numToCodepoint(Ux003F),tURL) throws errors.


Works for me too, but...

are those 'smart quotes' in your first example? That may be the problem.

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to escape wildcard chars - and find the offset of a '?' in a URL?

2021-03-14 Thread Håkan Liljegren via use-livecode
Hmm, strange! For me it works without problems:

put "https://www.mysite.com/?some=parameters=folllow; into tURL
put offset("?", tURL)

Returns 24

:-Håkan
On 14 Mar 2021, 17:29 +0100, BT via use-livecode 
, wrote:
> Hi folks,
> What’s the correct the syntax needed to escape a question mark so that its 
> offset can be found in a URL string?
>
> I get zero returned by put offset(“?”, tURL) and put offset( "?\",tURL) and 
> put offset( numToCodepoint(Ux003F),tURL) throws errors.
>
> The docs & forums cover escaping quotes but not wildcard characters.
>
> Thanks in advance for any steer.
> Best,
> Keith
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


How to escape wildcard chars - and find the offset of a '?' in a URL?

2021-03-14 Thread BT via use-livecode
Hi folks,
What’s the correct the syntax needed to escape a question mark so that its 
offset can be found in a URL string?

I get zero returned by put offset(“?”, tURL) and put offset( "?\",tURL) and put 
offset( numToCodepoint(Ux003F),tURL) throws errors.

The docs & forums cover escaping quotes but not wildcard characters.

Thanks in advance for any steer.
Best,
Keith
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Wildcard? replaceText, offset?

2020-04-29 Thread Ben Rubinstein via use-livecode
Not sure what 'previous post' referred to. Reg ex "[0-9]+" (or equivalently 
"\d+") would match one or more integers.


Provided this is the first/only instance of the pattern, I would have thought 
that regex does provide the neatest solution, e.g.:


put "(" & iNewNumber ")" into tReplacement
put replaceText(tOldString , "\(\d+\)", tReplacement) into tNewString


On 26/04/2020 20:15, dunbarx--- via use-livecode wrote:

Pay no attention to the previous post, which only dealt with a single integer. 
Sloppy.
THIS old fashioned method works, though:
on mouseUpput offset("(",yourString) into startCharput offset(")", yourString) 
into endCharput random(999) into char (startChar + 1) to (endChar -1) of yourStringend mouseUp

Craig

-Original Message-
From: doc hawk via use-livecode 
To: How to use LiveCode 
Cc: doc hawk 
Sent: Sun, Apr 26, 2020 2:41 pm
Subject: Re: Wildcard? replaceText, offset?


On Apr 26, 2020, at 11:24 AM, Rick reasoned


In the middle-end part of the string I have “(x)” where x represents some 
integer.
it could be (4) or (10) or (5) etc.



If you’re certain that this is the only, or even the first, integer, a regular 
expression search and replace or [0-9]+  would  do the trick.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Wildcard? replaceText, offset?

2020-04-27 Thread dunbarx--- via use-livecode
You are welcome.
Er, my offering IS a one liner.
Craig


-Original Message-
From: Rick Harrison via use-livecode 
To: How to use LiveCode 
Cc: Rick Harrison 
Sent: Mon, Apr 27, 2020 12:20 am
Subject: Re: Wildcard? replaceText, offset?

Thanks for the suggestions!

I was hoping that perhaps there was a very simple one liner or character that 
would do it for me.

I think I have a solution now.

Rick

> On Apr 26, 2020, at 3:15 PM, dunbarx--- via use-livecode 
>  wrote:
> 
> on mouseUpput offset("(",yourString) into startCharput offset(")", 
> yourString) into endCharput random(999) into char (startChar + 1) to (endChar 
> -1) of yourStringend mouseUp

___
use-livecode mailing list
use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Wildcard? replaceText, offset?

2020-04-27 Thread Thierry Douez via use-livecode


> Le 27 avr. 2020 à 08:37, J. Landman Gay via use-livecode 
>  a écrit :
> 
> On 4/26/20 1:24 PM, Rick Harrison via use-livecode wrote:
>> In the middle-end part of the string I have “(x)” where x represents some 
>> integer.
>> it could be (4) or (10) or (5) etc.
>> I just want to replace the number inside the () with whatever other number I 
>> need to.
> 


   local T = "a(1)(z)(345)xxx(567Z33)(666)"

   if  sunnYreplace( T, "\((\d+)\)",  "(42)",  Tr ) then   put Tr

   --> a(42)(z)(42)xxx(567Z33)(42)



Thanks to check https://sunny-tdz.com/livecode/sunnyrex 


Thierry

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Wildcard? replaceText, offset?

2020-04-27 Thread J. Landman Gay via use-livecode

On 4/26/20 1:24 PM, Rick Harrison via use-livecode wrote:

In the middle-end part of the string I have “(x)” where x represents some 
integer.
it could be (4) or (10) or (5) etc.

I just want to replace the number inside the () with whatever other number I 
need to.


If there is only a single instance, you could:

  replace "(x)" with "(" & someNumber & ")" in myString

If there is more than one instance then each instance would need a unique character inside the 
parentheses.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Wildcard? replaceText, offset?

2020-04-26 Thread Rick Harrison via use-livecode
Thanks for the suggestions!

I was hoping that perhaps there was a very simple one liner or character that 
would do it for me.

I think I have a solution now.

Rick

> On Apr 26, 2020, at 3:15 PM, dunbarx--- via use-livecode 
>  wrote:
> 
> on mouseUpput offset("(",yourString) into startCharput offset(")", 
> yourString) into endCharput random(999) into char (startChar + 1) to (endChar 
> -1) of yourStringend mouseUp

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Wildcard? replaceText, offset?

2020-04-26 Thread dunbarx--- via use-livecode
Pay no attention to the previous post, which only dealt with a single integer. 
Sloppy.
THIS old fashioned method works, though:
on mouseUpput offset("(",yourString) into startCharput offset(")", yourString) 
into endCharput random(999) into char (startChar + 1) to (endChar -1) of 
yourStringend mouseUp

Craig

-Original Message-
From: doc hawk via use-livecode 
To: How to use LiveCode 
Cc: doc hawk 
Sent: Sun, Apr 26, 2020 2:41 pm
Subject: Re: Wildcard? replaceText, offset?


On Apr 26, 2020, at 11:24 AM, Rick reasoned

> In the middle-end part of the string I have “(x)” where x represents some 
> integer.
> it could be (4) or (10) or (5) etc.


If you’re certain that this is the only, or even the first, integer, a regular 
expression search and replace or [0-9]+  would  do the trick.
___
use-livecode mailing list
use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Wildcard? replaceText, offset?

2020-04-26 Thread dunbarx--- via use-livecode
Or, more oil-fashioned, and again assuming that the integer in question is 
always the very first one in parentheses:
on mouseUpput random(99) into char offset("(",yourString) + 1 of yourStringend 
mouseUp
You will get tired of running this after only a few invocations.
Craig

-Original Message-
From: Rick Harrison via use-livecode 
To: How to use LiveCode 
Cc: Rick Harrison 
Sent: Sun, Apr 26, 2020 2:26 pm
Subject: Wildcard? replaceText, offset?

I have a very long string.

In the middle-end part of the string I have “(x)” where x represents some 
integer.
it could be (4) or (10) or (5) etc.

I just want to replace the number inside the () with whatever other number I 
need to.

I have been trying to find an easy way to do this.  Ideally a wildcard 
character like ? or *
would probably do it, but after going through the dictionary and getting lost 
with
filter, matchText, …  I finally decided perhaps one of you could make a better
suggestion.  It seems like this one should be very easy, but it’s not so easy 
if you
don’t do this kind of thing all the time.

Thanks,

Rick
___
use-livecode mailing list
use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Wildcard? replaceText, offset?

2020-04-26 Thread doc hawk via use-livecode

On Apr 26, 2020, at 11:24 AM, Rick reasoned

> In the middle-end part of the string I have “(x)” where x represents some 
> integer.
> it could be (4) or (10) or (5) etc.


If you’re certain that this is the only, or even the first, integer, a regular 
expression search and replace or [0-9]+  would  do the trick.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Wildcard? replaceText, offset?

2020-04-26 Thread Rick Harrison via use-livecode
I have a very long string.

In the middle-end part of the string I have “(x)” where x represents some 
integer.
it could be (4) or (10) or (5) etc.

I just want to replace the number inside the () with whatever other number I 
need to.

I have been trying to find an easy way to do this.  Ideally a wildcard 
character like ? or *
would probably do it, but after going through the dictionary and getting lost 
with
filter, matchText, …  I finally decided perhaps one of you could make a better
suggestion.  It seems like this one should be very easy, but it’s not so easy 
if you
don’t do this kind of thing all the time.

Thanks,

Rick
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


LC Wildcard filter citation source?

2018-12-08 Thread David V Glasgow via use-livecode
Hello folks,

I am writing an academic paper on an analysis of internet predator messages 
undertaken using an LC app.  

A few of the filtered terms I used incorporated wildcards (I avoided regular 
expressions).  I need to reference a published source for the implementation of 
wildcards within LC, if such a thing exists.

Does it?

Cheers,

David Glasgow
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter? replace? wildcard? reg exp? help please!

2017-05-19 Thread Thierry Douez via use-livecode
​

Is there life without internet for one week?

- lucky you are connected to the world again!
> Tiemo
>

​Hallo Tiemo,

Except some hurdles with the administration ( sold my old car and bought a
new one) plus being insulted by a couple of stressed and egotist people for
not answering sooner,
I did use this time to clean my garden,
did some house construction and enjoyed
to talk longer with friends in the city :)

But I'll have to work all the week-end now :)

Kind regards,

Thierry
​

> >
> >> put "1 [A] 2 [B] 3." into tText
> >> put  removeBrackets( tText)
> >>
> >
> > I see that the middle section is omitted with my regex, so I forgot to
> > make it non-greedy. But I've forgotten how to do that, something about
> > a question mark, I think?
>
>
> ​Sorry about the delay, we had a thunderstorm which broke all Internet
> network in our area since last Friday.
>
> You can do this in 2 ways:
>
> - make your .* non greedy by adding a '?' suffix
>
> - or modify your regex this way:
>
>"\[ [^\]]*]" which means looking for an open bracket followed by zero
> to any number of chars which are not a close bracket, and last a close
> bracket.
> BTW, no need to escape the last closing bracket; the regex engine is smart
> enough.
>
>
> PCRE library accepts the 2 forms.
>
> HTH,
>
> Thierry
>  ​
>

-- 

Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

AW: filter? replace? wildcard? reg exp? help please!

2017-05-19 Thread Tiemo Hollmann TB via use-livecode
Is there life without internet for one week? - lucky you are connected to the 
world again!
Tiemo


-Ursprüngliche Nachricht-
Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im Auftrag von 
Thierry Douez via use-livecode
Gesendet: Freitag, 19. Mai 2017 13:56
An: How to use LiveCode <use-livecode@lists.runrev.com>
Cc: Thierry Douez <th.do...@gmail.com>
Betreff: Re: filter? replace? wildcard? reg exp? help please!

>
>
>> put "1 [A] 2 [B] 3." into tText
>> put  removeBrackets( tText)
>>
>
> I see that the middle section is omitted with my regex, so I forgot to 
> make it non-greedy. But I've forgotten how to do that, something about 
> a question mark, I think?


​Sorry about the delay, we had a thunderstorm which broke all Internet network 
in our area since last Friday.

You can do this in 2 ways:

- make your .* non greedy by adding a '?' suffix

- or modify your regex this way:

   "\[ [^\]]*]" which means looking for an open bracket followed by zero to any 
number of chars which are not a close bracket, and last a close bracket.
BTW, no need to escape the last closing bracket; the regex engine is smart 
enough.


PCRE library accepts the 2 forms.

HTH,

Thierry
​
--

Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage 
___
use-livecode mailing list
use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-19 Thread Thierry Douez via use-livecode
>
>
>> put "1 [A] 2 [B] 3." into tText
>> put  removeBrackets( tText)
>>
>
> I see that the middle section is omitted with my regex, so I forgot to
> make it non-greedy. But I've forgotten how to do that, something about a
> question mark, I think?


​Sorry about the delay, we had a thunderstorm which broke all Internet
network
in our area since last Friday.

You can do this in 2 ways:

- make your .* non greedy by adding a '?' suffix

- or modify your regex this way:

   "\[ [^\]]*]" which means looking for an open bracket followed by zero to
any number of chars which are not a close bracket, and last a close bracket.
BTW, no need to escape the last closing bracket; the regex engine is smart
enough.


PCRE library accepts the 2 forms.

HTH,

Thierry
​
-- 

Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-12 Thread J. Landman Gay via use-livecode

On 5/12/17 3:37 PM, Thierry Douez via use-livecode wrote:

This should be a one-line command!
I've typed this post with the new Opera browser
???


Another try with 2 lines:

put "1 [A] 2 [B] 3." into tText
put  removeBrackets( tText)

​Better?


Yes. It's odd that a browser would reformat it that way.

I see that the middle section is omitted with my regex, so I forgot to 
make it non-greedy. But I've forgotten how to do that, something about a 
question mark, I think?


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-12 Thread Thierry Douez via use-livecode
>
>
>>
>>
>>> function removeBrackets pString
>>>   return replacetext(pString,"\[.*\]",empty)
>>> end removeBrackets
>>>
>> ​​
>>
>> What would be the result of next  line:?
>>
>> *put* removeBrackets
>> ​( ​
>> "1 [A] 2 [B] 3."
>> ​)
>>
>
> An error. I did warn about my limited regex skills. :)

So what should it be?
>
> Also, that's a non-standard format for a function.

I've never seen it written that way before.


​

This should be a one-line command!
I've typed this post with the new Opera browser
???


Another try with 2 lines:

put "1 [A] 2 [B] 3." into tText
put  removeBrackets( tText)

​Better?

Thierry​



Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-12 Thread J. Landman Gay via use-livecode

On 5/12/17 2:08 AM, Thierry Douez via use-livecode wrote:

​Hi,





function removeBrackets pString
  return replacetext(pString,"\[.*\]",empty)
end removeBrackets



​​

What would be the result of next  line:?

*put* removeBrackets
​( ​
"1 [A] 2 [B] 3."
​)


An error. I did warn about my limited regex skills. :) So what should it be?

Also, that's a non-standard format for a function. I've never seen it 
written that way before.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-12 Thread Thierry Douez via use-livecode
​Hi,



>
> function removeBrackets pString
>   return replacetext(pString,"\[.*\]",empty)
> end removeBrackets
>
>
​​

What would be the result of next  line:?

*put* removeBrackets
​( ​
"1 [A] 2 [B] 3."
​)


Kind regards,

Thierry
​

Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-10 Thread Nicolas Cueto via use-livecode
> Totally OT, but is this Dante, in Spanish??

Yes, and yes. From the verse translation of Ángel Crespo.

--
Nicolas Cueto

On 10 May 2017 at 19:57, Graham Samuel via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Totally OT, but is this Dante, in Spanish??
>
> Just askin’. I am not good with languages, as you can probably tell.
>
> Graham
>
> > On 10 May 2017, at 06:33, J. Landman Gay via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > On 5/9/17 11:16 PM, J. Landman Gay via use-livecode wrote:
> >> On 5/9/17 10:41 PM, Nicolas Cueto via use-livecode wrote:
> >>> Given this snippet...
> >>>
> >>> ---
> >>> CANTO XXXIV
> >>> CÍRCULO IX: TRAIDORES.
> >>> «Vexilla regis prodeunt[307] del Abismo
> >>> hacia nosotros[308], mas delante mira
> >>> 3—dijo el maestro— y los verás tú mismo.»
> >>> ---
> >>>
> >>> ... how do I use LC to remove the square-brackets and any string within
> >>> them, so that the snippet becomes...
> >>>
> >>> ---
> >>> CANTO XXXIV
> >>> CÍRCULO IX: TRAIDORES.
> >>> «Vexilla regis prodeunt del Abismo
> >>> hacia nosotros, mas delante mira
> >>> 3—dijo el maestro— y los verás tú mismo.»
> >>> ---
> >>
> >> This is about the only thing I know how to do with regext. :)
> >>
> >> on fix
> >>  put fld 1 into tText
> >>  put "\[.*\]" into tRegEx
> >>  put replacetext(tText,tRegEx,empty) into fld 2
> >> end fix
> >>
> >
> > You'd probably want it to be a function though:
> >
> > function removeBrackets pString
> >  return replacetext(pString,"\[.*\]",empty)
> > end removeBrackets
> >
> > --
> > Jacqueline Landman Gay | jac...@hyperactivesw.com
> > HyperActive Software   | http://www.hyperactivesw.com
> >
> >
> > ___
> > use-livecode mailing list
> > use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-10 Thread Graham Samuel via use-livecode
Totally OT, but is this Dante, in Spanish??

Just askin’. I am not good with languages, as you can probably tell.

Graham

> On 10 May 2017, at 06:33, J. Landman Gay via use-livecode 
>  wrote:
> 
> On 5/9/17 11:16 PM, J. Landman Gay via use-livecode wrote:
>> On 5/9/17 10:41 PM, Nicolas Cueto via use-livecode wrote:
>>> Given this snippet...
>>> 
>>> ---
>>> CANTO XXXIV
>>> CÍRCULO IX: TRAIDORES.
>>> «Vexilla regis prodeunt[307] del Abismo
>>> hacia nosotros[308], mas delante mira
>>> 3—dijo el maestro— y los verás tú mismo.»
>>> ---
>>> 
>>> ... how do I use LC to remove the square-brackets and any string within
>>> them, so that the snippet becomes...
>>> 
>>> ---
>>> CANTO XXXIV
>>> CÍRCULO IX: TRAIDORES.
>>> «Vexilla regis prodeunt del Abismo
>>> hacia nosotros, mas delante mira
>>> 3—dijo el maestro— y los verás tú mismo.»
>>> ---
>> 
>> This is about the only thing I know how to do with regext. :)
>> 
>> on fix
>>  put fld 1 into tText
>>  put "\[.*\]" into tRegEx
>>  put replacetext(tText,tRegEx,empty) into fld 2
>> end fix
>> 
> 
> You'd probably want it to be a function though:
> 
> function removeBrackets pString
>  return replacetext(pString,"\[.*\]",empty)
> end removeBrackets
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> 
> 
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-09 Thread J. Landman Gay via use-livecode

On 5/9/17 11:16 PM, J. Landman Gay via use-livecode wrote:

On 5/9/17 10:41 PM, Nicolas Cueto via use-livecode wrote:

Given this snippet...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt[307] del Abismo
hacia nosotros[308], mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

... how do I use LC to remove the square-brackets and any string within
them, so that the snippet becomes...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt del Abismo
hacia nosotros, mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---


This is about the only thing I know how to do with regext. :)

on fix
  put fld 1 into tText
  put "\[.*\]" into tRegEx
  put replacetext(tText,tRegEx,empty) into fld 2
end fix



You'd probably want it to be a function though:

function removeBrackets pString
  return replacetext(pString,"\[.*\]",empty)
end removeBrackets

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-09 Thread Nicolas Cueto via use-livecode
​Thank you everyone. Went with ​Jacqueline's, cause fastest.

--
N. Cueto
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-09 Thread J. Landman Gay via use-livecode

On 5/9/17 10:41 PM, Nicolas Cueto via use-livecode wrote:

Given this snippet...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt[307] del Abismo
hacia nosotros[308], mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

... how do I use LC to remove the square-brackets and any string within
them, so that the snippet becomes...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt del Abismo
hacia nosotros, mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---


This is about the only thing I know how to do with regext. :)

on fix
  put fld 1 into tText
  put "\[.*\]" into tRegEx
  put replacetext(tText,tRegEx,empty) into fld 2
end fix

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-09 Thread Phil Davis via use-livecode

There is probably an easier way, but this works:

   on mouseUp
put "]" & field 1 into tText
set the lineDelimiter to "["
set the itemDelimiter to "]"
repeat for each line tLine in tText
put item 2 to -1 of tLine after tNewText
end repeat
put tNewText into field 2
   end mouseUp

HTH -
Phil Davis


On 5/9/17 8:41 PM, Nicolas Cueto via use-livecode wrote:

Given this snippet...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt[307] del Abismo
hacia nosotros[308], mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

... how do I use LC to remove the square-brackets and any string within
them, so that the snippet becomes...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt del Abismo
hacia nosotros, mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

Muchas gracias.

--
Nicolás Cueto
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


--
Phil Davis

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-09 Thread Peter Bogdanoff via use-livecode
Try—
put your text into tText, then

repeat forever
if offset("[",tText) is not empty then
delete char (offset("[",tText)) to (offset("]",tText)) of tText
else
exit repeat
end repeat



On May 9, 2017, at 8:54 PM, Peter Bogdanoff via use-livecode 
 wrote:

> use offset.
> 
> Peter
> 
> 
> On May 9, 2017, at 8:41 PM, Nicolas Cueto via use-livecode 
>  wrote:
> 
>> Given this snippet...
>> 
>> ---
>> CANTO XXXIV
>> CÍRCULO IX: TRAIDORES.
>> «Vexilla regis prodeunt[307] del Abismo
>> hacia nosotros[308], mas delante mira
>> 3—dijo el maestro— y los verás tú mismo.»
>> ---
>> 
>> ... how do I use LC to remove the square-brackets and any string within
>> them, so that the snippet becomes...
>> 
>> ---
>> CANTO XXXIV
>> CÍRCULO IX: TRAIDORES.
>> «Vexilla regis prodeunt del Abismo
>> hacia nosotros, mas delante mira
>> 3—dijo el maestro— y los verás tú mismo.»
>> ---
>> 
>> Muchas gracias.
>> 
>> --
>> Nicolás Cueto
>> ___
>> use-livecode mailing list
>> use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter? replace? wildcard? reg exp? help please!

2017-05-09 Thread Peter Bogdanoff via use-livecode
use offset.

Peter


On May 9, 2017, at 8:41 PM, Nicolas Cueto via use-livecode 
 wrote:

> Given this snippet...
> 
> ---
> CANTO XXXIV
> CÍRCULO IX: TRAIDORES.
> «Vexilla regis prodeunt[307] del Abismo
> hacia nosotros[308], mas delante mira
> 3—dijo el maestro— y los verás tú mismo.»
> ---
> 
> ... how do I use LC to remove the square-brackets and any string within
> them, so that the snippet becomes...
> 
> ---
> CANTO XXXIV
> CÍRCULO IX: TRAIDORES.
> «Vexilla regis prodeunt del Abismo
> hacia nosotros, mas delante mira
> 3—dijo el maestro— y los verás tú mismo.»
> ---
> 
> Muchas gracias.
> 
> --
> Nicolás Cueto
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


filter? replace? wildcard? reg exp? help please!

2017-05-09 Thread Nicolas Cueto via use-livecode
Given this snippet...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt[307] del Abismo
hacia nosotros[308], mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

... how do I use LC to remove the square-brackets and any string within
them, so that the snippet becomes...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt del Abismo
hacia nosotros, mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

Muchas gracias.

--
Nicolás Cueto
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Any characters wildcard or regex?

2016-09-22 Thread Dave Cragg

> On 22 Sep 2016, at 16:45, Keith Clarke  wrote:
> 
> Thanks Mike, pilot error here - replacetext(tData,"<.*>",empty) looks to be a 
> viable direction of travel once correctly typed. Time to rest my eyes, 
> methinks! 8-)
> Best,
> Keith..

I think you might need replacetext(tData,"<.*?>",empty)

The '?' cause the match to be non-greedy. Without it, everything from the first 
"<" to the last ">" will be replaced.

Cheers
Dave
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Any characters wildcard or regex?

2016-09-22 Thread Keith Clarke
Thanks Mike, pilot error here - replacetext(tData,"<.*>",empty) looks to be a 
viable direction of travel once correctly typed. Time to rest my eyes, 
methinks! 8-)
Best,
Keith..
  
> On 22 Sep 2016, at 16:23, Mike Bonner <bonnm...@gmail.com> wrote:
> 
> if you want to use regex, I think you have to use replacetext rather than
> replace, unless replace has been updated when I wasn't looking.
> I did a quicky test..
> 
> put field 1 into tData -- field with text containing html tags
> put replacetext(tData,"<.*>",empty) into tNewData
> put tNewData
> 
> Also, in your example above I assume you correctly set the htmltext rather
> than the html..
> 
> On Thu, Sep 22, 2016 at 8:46 AM, Keith Clarke <keith.cla...@me.com> wrote:
> 
>> Thanks Mike & Klaus,
>> The simple line 'replace "<.*>" with empty in tFileText’ would be ideal,
>> but it seems to be ignored.
>> 
>> The html approach seems to hit an early hurdle, too - if I...
>> 
>> set the html of field "FldFileText" to URL(tFileName)
>> set the text of field "FldFileText" to the text of field “FldFileText
>> 
>> ...this results in an empty field after the first or both lines. Perhaps
>> this is because the source file is a CSV with only one item having any HTML
>> tags?
>> 
>> Just to clarify the problem - the source text I’m working with comes from
>> CSV file imports and some files contain RTF fields amongst their items.
>> These RTF styling tags sometimes contain quotes & commas that are causing
>> occasional glitches with the CSV item delimiting - hence the need to
>> pre-process and strip out all tags before processing the CSV import.
>> 
>> Thanks again for your insights.
>> Best,
>> Keith..
>> 
>>> On 22 Sep 2016, at 15:12, Klaus major-k <kl...@major-k.de> wrote:
>>> 
>>> Hi Mike and Keith,
>>> 
>>>> Am 22.09.2016 um 16:03 schrieb Mike Bonner <bonnm...@gmail.com>:
>>>> 
>>>> Using replacetext, you're probably looking for "<.*>"
>>>> but you might be able to use a field for this..  set the htmltext of the
>>>> field to your source text, Then if you don't want the formatting
>> preserved
>>>> set the text of the field to the text of the field.  One problem with
>> this
>>>> method is that you may end up with javascript left over because it can
>>>> appear between  and 
>>> 
>>> you can even (ab)use "the templatefield" for this:
>>> ...
>>> set the htmltext of the templatefield to url("http://your_url/here.html
>> ")
>>> put the text of the templatefield into fld 1 # or a variable
>>> reset the templatefield ## !!
>>> ...
>>> 
>>>> On Thu, Sep 22, 2016 at 7:34 AM, Keith Clarke <keith.cla...@me.com>
>> wrote:
>>>> 
>>>>> Hi folks,
>>>>> I’m trying to strip out all HTML tags from text in a variable.
>> Replacement
>>>>> of specific tags works fine... replace “" with empty in tText …but
>> I’m
>>>>> struggling to find (documentation on) a blanket ‘any number of any
>>>>> characters’ wildcard or regex approach...
>>>>> 
>>>>> So far I’ve tried "<*>”, “<[*]>”,  “<[.*]>”, "<" & "[.*]" & “>” to no
>> avail
>>>>> 
>>>>> Any clues greatly appreciated.
>>>>> Best,
>>>>> Keith..
>>> 
>>> Best
>>> 
>>> Klaus
>>> 
>>> --
>>> Klaus Major
>>> http://www.major-k.de
>>> kl...@major-k.de
>>> 
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@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@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Any characters wildcard or regex?

2016-09-22 Thread Mike Bonner
if you want to use regex, I think you have to use replacetext rather than
replace, unless replace has been updated when I wasn't looking.
I did a quicky test..

put field 1 into tData -- field with text containing html tags
put replacetext(tData,"<.*>",empty) into tNewData
put tNewData

Also, in your example above I assume you correctly set the htmltext rather
than the html..

On Thu, Sep 22, 2016 at 8:46 AM, Keith Clarke <keith.cla...@me.com> wrote:

> Thanks Mike & Klaus,
> The simple line 'replace "<.*>" with empty in tFileText’ would be ideal,
> but it seems to be ignored.
>
> The html approach seems to hit an early hurdle, too - if I...
>
> set the html of field "FldFileText" to URL(tFileName)
> set the text of field "FldFileText" to the text of field “FldFileText
>
> ...this results in an empty field after the first or both lines. Perhaps
> this is because the source file is a CSV with only one item having any HTML
> tags?
>
> Just to clarify the problem - the source text I’m working with comes from
> CSV file imports and some files contain RTF fields amongst their items.
> These RTF styling tags sometimes contain quotes & commas that are causing
> occasional glitches with the CSV item delimiting - hence the need to
> pre-process and strip out all tags before processing the CSV import.
>
> Thanks again for your insights.
> Best,
> Keith..
>
> > On 22 Sep 2016, at 15:12, Klaus major-k <kl...@major-k.de> wrote:
> >
> > Hi Mike and Keith,
> >
> >> Am 22.09.2016 um 16:03 schrieb Mike Bonner <bonnm...@gmail.com>:
> >>
> >> Using replacetext, you're probably looking for "<.*>"
> >> but you might be able to use a field for this..  set the htmltext of the
> >> field to your source text, Then if you don't want the formatting
> preserved
> >> set the text of the field to the text of the field.  One problem with
> this
> >> method is that you may end up with javascript left over because it can
> >> appear between  and 
> >
> > you can even (ab)use "the templatefield" for this:
> > ...
> > set the htmltext of the templatefield to url("http://your_url/here.html
> ")
> > put the text of the templatefield into fld 1 # or a variable
> > reset the templatefield ## !!
> > ...
> >
> >> On Thu, Sep 22, 2016 at 7:34 AM, Keith Clarke <keith.cla...@me.com>
> wrote:
> >>
> >>> Hi folks,
> >>> I’m trying to strip out all HTML tags from text in a variable.
> Replacement
> >>> of specific tags works fine... replace “" with empty in tText …but
> I’m
> >>> struggling to find (documentation on) a blanket ‘any number of any
> >>> characters’ wildcard or regex approach...
> >>>
> >>> So far I’ve tried "<*>”, “<[*]>”,  “<[.*]>”, "<" & "[.*]" & “>” to no
> avail
> >>>
> >>> Any clues greatly appreciated.
> >>> Best,
> >>> Keith..
> >
> > Best
> >
> > Klaus
> >
> > --
> > Klaus Major
> > http://www.major-k.de
> > kl...@major-k.de
> >
> >
> > ___
> > use-livecode mailing list
> > use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Any characters wildcard or regex?

2016-09-22 Thread Keith Clarke
Thanks Mike & Klaus,
The simple line 'replace "<.*>" with empty in tFileText’ would be ideal, but it 
seems to be ignored.

The html approach seems to hit an early hurdle, too - if I...

set the html of field "FldFileText" to URL(tFileName)
set the text of field "FldFileText" to the text of field “FldFileText

...this results in an empty field after the first or both lines. Perhaps this 
is because the source file is a CSV with only one item having any HTML tags?

Just to clarify the problem - the source text I’m working with comes from CSV 
file imports and some files contain RTF fields amongst their items. These RTF 
styling tags sometimes contain quotes & commas that are causing occasional 
glitches with the CSV item delimiting - hence the need to pre-process and strip 
out all tags before processing the CSV import. 

Thanks again for your insights.
Best,
Keith..

> On 22 Sep 2016, at 15:12, Klaus major-k <kl...@major-k.de> wrote:
> 
> Hi Mike and Keith,
> 
>> Am 22.09.2016 um 16:03 schrieb Mike Bonner <bonnm...@gmail.com>:
>> 
>> Using replacetext, you're probably looking for "<.*>"
>> but you might be able to use a field for this..  set the htmltext of the
>> field to your source text, Then if you don't want the formatting preserved
>> set the text of the field to the text of the field.  One problem with this
>> method is that you may end up with javascript left over because it can
>> appear between  and 
> 
> you can even (ab)use "the templatefield" for this:
> ...
> set the htmltext of the templatefield to url("http://your_url/here.html;)
> put the text of the templatefield into fld 1 # or a variable
> reset the templatefield ## !!
> ...
> 
>> On Thu, Sep 22, 2016 at 7:34 AM, Keith Clarke <keith.cla...@me.com> wrote:
>> 
>>> Hi folks,
>>> I’m trying to strip out all HTML tags from text in a variable. Replacement
>>> of specific tags works fine... replace “" with empty in tText …but I’m
>>> struggling to find (documentation on) a blanket ‘any number of any
>>> characters’ wildcard or regex approach...
>>> 
>>> So far I’ve tried "<*>”, “<[*]>”,  “<[.*]>”, "<" & "[.*]" & “>” to no avail
>>> 
>>> Any clues greatly appreciated.
>>> Best,
>>> Keith..
> 
> Best
> 
> Klaus
> 
> --
> Klaus Major
> http://www.major-k.de
> kl...@major-k.de
> 
> 
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Any characters wildcard or regex?

2016-09-22 Thread Klaus major-k
Hi Mike and Keith,

> Am 22.09.2016 um 16:03 schrieb Mike Bonner <bonnm...@gmail.com>:
> 
> Using replacetext, you're probably looking for "<.*>"
> but you might be able to use a field for this..  set the htmltext of the
> field to your source text, Then if you don't want the formatting preserved
> set the text of the field to the text of the field.  One problem with this
> method is that you may end up with javascript left over because it can
> appear between  and 

you can even (ab)use "the templatefield" for this:
...
set the htmltext of the templatefield to url("http://your_url/here.html;)
put the text of the templatefield into fld 1 # or a variable
reset the templatefield ## !!
...

> On Thu, Sep 22, 2016 at 7:34 AM, Keith Clarke <keith.cla...@me.com> wrote:
> 
>> Hi folks,
>> I’m trying to strip out all HTML tags from text in a variable. Replacement
>> of specific tags works fine... replace “" with empty in tText …but I’m
>> struggling to find (documentation on) a blanket ‘any number of any
>> characters’ wildcard or regex approach...
>> 
>> So far I’ve tried "<*>”, “<[*]>”,  “<[.*]>”, "<" & "[.*]" & “>” to no avail
>> 
>> Any clues greatly appreciated.
>> Best,
>> Keith..

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Any characters wildcard or regex?

2016-09-22 Thread Mike Bonner
Using replacetext, you're probably looking for "<.*>"
but you might be able to use a field for this..  set the htmltext of the
field to your source text, Then if you don't want the formatting preserved
set the text of the field to the text of the field.  One problem with this
method is that you may end up with javascript left over because it can
appear between  and 

On Thu, Sep 22, 2016 at 7:34 AM, Keith Clarke <keith.cla...@me.com> wrote:

> Hi folks,
> I’m trying to strip out all HTML tags from text in a variable. Replacement
> of specific tags works fine... replace “" with empty in tText …but I’m
> struggling to find (documentation on) a blanket ‘any number of any
> characters’ wildcard or regex approach...
>
> So far I’ve tried "<*>”, “<[*]>”,  “<[.*]>”, "<" & "[.*]" & “>” to no avail
>
> Any clues greatly appreciated.
> Best,
> Keith..
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Any characters wildcard or regex?

2016-09-22 Thread Keith Clarke
Hi folks,
I’m trying to strip out all HTML tags from text in a variable. Replacement of 
specific tags works fine... replace “" with empty in tText …but I’m 
struggling to find (documentation on) a blanket ‘any number of any characters’ 
wildcard or regex approach...

So far I’ve tried "<*>”, “<[*]>”,  “<[.*]>”, "<" & "[.*]" & “>” to no avail

Any clues greatly appreciated.
Best,
Keith..
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Wildcard Livecode 8

2016-07-27 Thread Kay C Lan
On Sun, Jul 24, 2016 at 1:51 AM, Richmond <richmondmathew...@gmail.com> wrote:

> Which tells me nothing useful whatsoever; such as what the wildcard
> character might be, or how to
>
> use wildcards in Livecode.
>
Lookup the online Dictionary for 'filter', it's in the 'command'
folder. I think it is the only one that has it's own set of wildcard
characters.

Most other functions that use wildcards (ie matchText, replaceText)
are those that require regex. LC uses PCRE so you can check that out
here:

https://regex101.com/#pcre

Down in the bottom right corner is a 'Quick Reference', and 'most used
tokens' is likely selected so you can see that:

. = any character (a true wild card)
\d = any digit
\w = any word character etc etc

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Wildcard Livecode 8

2016-07-23 Thread Richmond
Looking up 'Wildcard' in the online Livecode Dictionary (because the 
64-bit Linux version


is non-functional) one gets this:



  wildcard

name
wildcard
type
glossary
synonyms
wild card,wildcard,wildcard expression,glob,globbing,globbed,globular 
expansion,globular expression

Related
glossary: character <javascript:void(0)>
description

A symbol that stands for one or more characters <javascript:void(0)>. 
The process of expanding a wildcard to match all its possible strings 
is called globbing (after "global").


Which tells me nothing useful whatsoever; such as what the wildcard 
character might be, or how to


use wildcards in Livecode.

Richmond.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Wildcard?

2016-05-10 Thread RM
Oh, look: I'm like a dog returning to its own vomit: 
http://runtime-revolution.278305.n4.nabble.com/Wildcards-td4669119.html


Useless last time: I wonder what chances this time?

Funny considering a lot of other programming languages do use wildcard 
characters (that's a bitchy comment,à l'anglais).


Richmond.

On 10.05.2016 23:33, RM wrote:
Well, here I am reading my "Revolution 1.1.1" User Guide because when 
I was
soaking in a nice hot bath (an excellent location for thinking about 
Livecode)
I suddenly thought of a "problem", which, on reflection congealed 
around the

term "Wildcard".

Now in the "Revolution 1.1.1" User Guide, page 374 it has this to say:

Wildcard
A symbol that stands for one or more characters.

Which made me think I was back in the bath-tub staring at my navel.

Couldn't find anything else anywhere at all.

Now I was merrily imagining a stack where a source "spat out" new images
every 10 seconds and called them T1, T2, T3 . . . . and so on, 
theoretically
for ever, and a "gobbler" (meaning another image) chasing these images 
and

messing around with "intersect" as one does.

That, Ding-An-Sich, should not be all that hard.

But the code would be a pain-in-the-bum without a wildcard character.

HOWEVER, I cannot, for the life of me, find out which character IS the
wildcard character in Livecode.

I DON'T want to use Regex as I want to use this with kiddos in
their elementary progging classes this summer.

ALL I can find are refs to matchChunk and matchText.

Now what I need is a way to do this sort of thing:

on arrowkey AK
  if AK = "left" then
   put item 1 of the loc of img "Gobbler" into G1
   put item 2 of the loc of img "Gobbler" into G2
   put (G1 - 10) into G1
move img "Gobbler" to G1, G2
 end if
 ---more of the same with "right", "up", and "down"
 if intersect(img "Gobbler", img "T#") then
   --do something boring
end if

where "#" is the wildcard character.

Richmond.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Wildcard?

2016-05-10 Thread RM

Well, here I am reading my "Revolution 1.1.1" User Guide because when I was
soaking in a nice hot bath (an excellent location for thinking about 
Livecode)

I suddenly thought of a "problem", which, on reflection congealed around the
term "Wildcard".

Now in the "Revolution 1.1.1" User Guide, page 374 it has this to say:

Wildcard
A symbol that stands for one or more characters.

Which made me think I was back in the bath-tub staring at my navel.

Couldn't find anything else anywhere at all.

Now I was merrily imagining a stack where a source "spat out" new images
every 10 seconds and called them T1, T2, T3 . . . . and so on, theoretically
for ever, and a "gobbler" (meaning another image) chasing these images and
messing around with "intersect" as one does.

That, Ding-An-Sich, should not be all that hard.

But the code would be a pain-in-the-bum without a wildcard character.

HOWEVER, I cannot, for the life of me, find out which character IS the
wildcard character in Livecode.

I DON'T want to use Regex as I want to use this with kiddos in
their elementary progging classes this summer.

ALL I can find are refs to matchChunk and matchText.

Now what I need is a way to do this sort of thing:

on arrowkey AK
  if AK = "left" then
   put item 1 of the loc of img "Gobbler" into G1
   put item 2 of the loc of img "Gobbler" into G2
   put (G1 - 10) into G1
move img "Gobbler" to G1, G2
 end if
 ---more of the same with "right", "up", and "down"
 if intersect(img "Gobbler", img "T#") then
   --do something boring
end if

where "#" is the wildcard character.

Richmond.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: parameterized query with wildcard

2015-07-30 Thread Bob Sneidar
Yes it does. If you use the placeholder method (I am not really sure what to 
call it at this point) then sqlYoga sanitizes the strings for you. I've 
inserted records with any number of characters using this method without any 
problems reading in or out of the database. 

I'm not sure if a direct query like address = '\\bobscomputer\scans' is 
sanitized. For the sake of standardization I always use the placeholder method. 

Bob S


 On Jul 28, 2015, at 09:17 , Andrew Kluthe and...@ctech.me wrote:
 
 Does revDataFromQuery do any sanitizing/proper to prevent me from sneaking
 extra SQL into your search box like an injection style attack, or does it
 just plop whatever you give in there no questions asked? Just curious. I
 have always been spoiled by SQLYoga or rolled my DB interfaces up into API
 servers of some kind.
 
 On Tue, Jul 28, 2015 at 11:09 AM Dave Kilroy d...@applicationinsight.com
 wrote:
 
 Mike, assuming you are searching the db with parameter pSearchTerm, try
 something like this:
 
 
 put %  pSearchTerm  % into tSearchTerm
 put SELECT * FROM foo WHERE bar LIKE :1 into tQuery
 get revDataFromQuery(tab, return, sDBID, tQuery, tSearchTerm)
 
 
 
 
 
 
 -
 The difference between genius and stupidity is; genius has its limits. -
 Albert Einstein
 --
 View this message in context:
 http://runtime-revolution.278305.n4.nabble.com/parameterized-query-with-wildcard-tp4694407p4694419.html
 Sent from the Revolution - User mailing list archive at Nabble.com.
 
 ___
 use-livecode mailing list
 use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: parameterized query with wildcard

2015-07-30 Thread Peter Haworth
I feel I should point out that you are leaving yourself wide open to SQL
injection attacks by not using the placeholder method of passing data to
SQL statements.  Not enough space to detail how that works here but just
Google SQL injection on the web to see a sample of the really bad things
that can happen.

When you use placeholders, the SQL statement and the values in the
placeholder variables are sent to the database separately which gives you
full protection against SQL injection attacks.

On Wed, Jul 29, 2015 at 10:02 AM PystCat pyst...@gmail.com wrote:

 When I get that value from the user it is scrubbed and then put into the
 SQL with the merge.




  On Jul 29, 2015, at 12:18 PM, Peter Haworth p...@lcsql.com wrote:
 
  But why bother?  You're already putting the value into a variable so all
  that's required is use :1 and append the variable name to the revxxx
 call.
  On Wed, Jul 29, 2015 at 8:29 AM PystCat pyst...@gmail.com wrote:
 
  Not a problem... Scrub the variable before the merge... It's what I do
 as
  well.  I have a function that takes the input and scrubs it... I'm away
 for
  another week but if you're interested, when I get back I can post the
  handler.
 
 
 
  On Jul 29, 2015, at 10:35 AM, Mike Kerner mikeker...@roadrunner.com
  wrote:
 
  The reason for using parameterized queries instead of either merging or
  appending is because of SQL injection.
 
  On Wed, Jul 29, 2015 at 10:18 AM, PystCat pyst...@gmail.com wrote:
 
  Why not just use merge...?
 
  Put John into tVal
  Put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]])) into pSQL
  OR
  put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]]%)) into pSQL
 
  I do this for all of my queries and it works fine.
 
  Paul
 
 
 
 
  On Jul 29, 2015, at 9:45 AM, Mike Kerner mikeker...@roadrunner.com
 
  wrote:
 
  If I was guessing, my hunch would be that including the single-quotes
  is
  going to make the db look for strings containing %:1%, instead of
 using
  the
  wildcards and the parameter.
 
  On Wed, Jul 29, 2015 at 9:31 AM, Mike Kerner 
  mikeker...@roadrunner.com
  wrote:
 
  Nope.  That doesn't work, Bob.  That returns nothing.
 
  On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar 
  bobsnei...@iotecdigital.com
  wrote:
 
  Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.
 
  If you are searching for a value at the beginning, LIKE ‘:1%’ or at
  the
  end, LIKE ‘%:1’
 
  If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ OR
  column
  LIKE ‘%:1’
 
  HTH
 
  Bob S
 
 
  On Jul 28, 2015, at 08:16 , Mike Kerner 
 mikeker...@roadrunner.com
 
  wrote:
 
  Has anybody built any queries that use both parameters and
  wildcards,
  e.g.
  in a LIKE statement?
 
  SELECT * FROM foo WHERE bar LIKE %:1%
 
  I've tried the above (error), I've tried '%':1'%' (error), and
 I've
  tried
  appending the % to the container I'm passing as my :1 (doesn't
  work).
 
  I really don't want to do this the unsafe way.
  --
  On the first day, God created the heavens and the Earth
  On the second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours,
  and did a little diving.
  And God said, This is good.
  ___
  use-livecode mailing list
  use-livecode@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@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
  --
  On the first day, God created the heavens and the Earth
  On the second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours,
  and did a little diving.
  And God said, This is good.
 
 
 
  --
  On the first day, God created the heavens and the Earth
  On the second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours,
  and did a little diving.
  And God said, This is good.
  ___
  use-livecode mailing list
  use-livecode@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@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
  --
  On the first day, God created the heavens and the Earth
  On the second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours,
   and did a little diving.
  And God said, This is good.
  ___
  use-livecode mailing 

RE: parameterized query with wildcard

2015-07-30 Thread Ralph DiMola
Peter,

If you using an SSL connection to the DB is there still SQL injection risks?

3...2...1... and Mark Wieder says Use a web service

Then I will +1 it. I have almost completely moved to the https web service 
model for remote DB access.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
Peter Haworth
Sent: Thursday, July 30, 2015 2:47 PM
To: How to use LiveCode
Subject: Re: parameterized query with wildcard

I feel I should point out that you are leaving yourself wide open to SQL 
injection attacks by not using the placeholder method of passing data to SQL 
statements.  Not enough space to detail how that works here but just Google 
SQL injection on the web to see a sample of the really bad things that can 
happen.

When you use placeholders, the SQL statement and the values in the placeholder 
variables are sent to the database separately which gives you full protection 
against SQL injection attacks.

On Wed, Jul 29, 2015 at 10:02 AM PystCat pyst...@gmail.com wrote:

 When I get that value from the user it is scrubbed and then put into 
 the SQL with the merge.




  On Jul 29, 2015, at 12:18 PM, Peter Haworth p...@lcsql.com wrote:
 
  But why bother?  You're already putting the value into a variable so 
  all that's required is use :1 and append the variable name to the 
  revxxx
 call.
  On Wed, Jul 29, 2015 at 8:29 AM PystCat pyst...@gmail.com wrote:
 
  Not a problem... Scrub the variable before the merge... It's what I 
  do
 as
  well.  I have a function that takes the input and scrubs it... I'm 
  away
 for
  another week but if you're interested, when I get back I can post 
  the handler.
 
 
 
  On Jul 29, 2015, at 10:35 AM, Mike Kerner 
  mikeker...@roadrunner.com
  wrote:
 
  The reason for using parameterized queries instead of either 
  merging or appending is because of SQL injection.
 
  On Wed, Jul 29, 2015 at 10:18 AM, PystCat pyst...@gmail.com wrote:
 
  Why not just use merge...?
 
  Put John into tVal
  Put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]])) into 
  pSQL OR put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]]%)) 
  into pSQL
 
  I do this for all of my queries and it works fine.
 
  Paul
 
 
 
 
  On Jul 29, 2015, at 9:45 AM, Mike Kerner 
  mikeker...@roadrunner.com
 
  wrote:
 
  If I was guessing, my hunch would be that including the 
  single-quotes
  is
  going to make the db look for strings containing %:1%, instead 
  of
 using
  the
  wildcards and the parameter.
 
  On Wed, Jul 29, 2015 at 9:31 AM, Mike Kerner 
  mikeker...@roadrunner.com
  wrote:
 
  Nope.  That doesn't work, Bob.  That returns nothing.
 
  On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar 
  bobsnei...@iotecdigital.com
  wrote:
 
  Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.
 
  If you are searching for a value at the beginning, LIKE ‘:1%’ 
  or at
  the
  end, LIKE ‘%:1’
 
  If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ 
  OR
  column
  LIKE ‘%:1’
 
  HTH
 
  Bob S
 
 
  On Jul 28, 2015, at 08:16 , Mike Kerner 
 mikeker...@roadrunner.com
 
  wrote:
 
  Has anybody built any queries that use both parameters and
  wildcards,
  e.g.
  in a LIKE statement?
 
  SELECT * FROM foo WHERE bar LIKE %:1%
 
  I've tried the above (error), I've tried '%':1'%' (error), 
  and
 I've
  tried
  appending the % to the container I'm passing as my :1 
  (doesn't
  work).
 
  I really don't want to do this the unsafe way.
  --
  On the first day, God created the heavens and the Earth On 
  the second day, God created the oceans.
  On the third day, God put the animals on hold for a few 
  hours, and did a little diving.
  And God said, This is good.
  ___
  use-livecode mailing list
  use-livecode@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@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage 
  your subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
  --
  On the first day, God created the heavens and the Earth On the 
  second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours, 
  and did a little diving.
  And God said, This is good.
 
 
 
  --
  On the first day, God created the heavens and the Earth On the 
  second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours, 
  and did a little diving.
  And God said, This is good.
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http

Re: parameterized query with wildcard

2015-07-30 Thread Mark Waddingham
Injection attacks are caused by a lack of validation of the inputs used to 
construct a query - they are independent of any transport mechanism.

Even fronting db access with a web service will cause a vector for injection 
attacks if the web service is constructing query strings without validating or 
escaping inputs which are put directly into said strings.

As previously mentioned on this thread, placeholders mitigate the problem 
because DBs treat them as parameters to a query, rather than building a query 
with their content concatenated into the query string.

Mark.

Sent from my iPhone

 On 30 Jul 2015, at 19:57, Ralph DiMola rdim...@evergreeninfo.net wrote:
 
 Peter,
 
 If you using an SSL connection to the DB is there still SQL injection risks?
 
 3...2...1... and Mark Wieder says Use a web service
 
 Then I will +1 it. I have almost completely moved to the https web service 
 model for remote DB access.
 
 Ralph DiMola
 IT Director
 Evergreen Information Services
 rdim...@evergreeninfo.net
 
 
 -Original Message-
 From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf 
 Of Peter Haworth
 Sent: Thursday, July 30, 2015 2:47 PM
 To: How to use LiveCode
 Subject: Re: parameterized query with wildcard
 
 I feel I should point out that you are leaving yourself wide open to SQL 
 injection attacks by not using the placeholder method of passing data to SQL 
 statements.  Not enough space to detail how that works here but just Google 
 SQL injection on the web to see a sample of the really bad things that can 
 happen.
 
 When you use placeholders, the SQL statement and the values in the 
 placeholder variables are sent to the database separately which gives you 
 full protection against SQL injection attacks.
 
 On Wed, Jul 29, 2015 at 10:02 AM PystCat pyst...@gmail.com wrote:
 
 When I get that value from the user it is scrubbed and then put into 
 the SQL with the merge.
 
 
 
 
 On Jul 29, 2015, at 12:18 PM, Peter Haworth p...@lcsql.com wrote:
 
 But why bother?  You're already putting the value into a variable so 
 all that's required is use :1 and append the variable name to the 
 revxxx
 call.
 On Wed, Jul 29, 2015 at 8:29 AM PystCat pyst...@gmail.com wrote:
 
 Not a problem... Scrub the variable before the merge... It's what I 
 do
 as
 well.  I have a function that takes the input and scrubs it... I'm 
 away
 for
 another week but if you're interested, when I get back I can post 
 the handler.
 
 
 
 On Jul 29, 2015, at 10:35 AM, Mike Kerner 
 mikeker...@roadrunner.com
 wrote:
 
 The reason for using parameterized queries instead of either 
 merging or appending is because of SQL injection.
 
 On Wed, Jul 29, 2015 at 10:18 AM, PystCat pyst...@gmail.com wrote:
 
 Why not just use merge...?
 
 Put John into tVal
 Put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]])) into 
 pSQL OR put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]]%)) 
 into pSQL
 
 I do this for all of my queries and it works fine.
 
 Paul
 
 
 
 
 On Jul 29, 2015, at 9:45 AM, Mike Kerner 
 mikeker...@roadrunner.com
 
 wrote:
 
 If I was guessing, my hunch would be that including the 
 single-quotes
 is
 going to make the db look for strings containing %:1%, instead 
 of
 using
 the
 wildcards and the parameter.
 
 On Wed, Jul 29, 2015 at 9:31 AM, Mike Kerner 
 mikeker...@roadrunner.com
 wrote:
 
 Nope.  That doesn't work, Bob.  That returns nothing.
 
 On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar 
 bobsnei...@iotecdigital.com
 wrote:
 
 Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.
 
 If you are searching for a value at the beginning, LIKE ‘:1%’ 
 or at
 the
 end, LIKE ‘%:1’
 
 If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ 
 OR
 column
 LIKE ‘%:1’
 
 HTH
 
 Bob S
 
 
 On Jul 28, 2015, at 08:16 , Mike Kerner 
 mikeker...@roadrunner.com
 
 wrote:
 
 Has anybody built any queries that use both parameters and
 wildcards,
 e.g.
 in a LIKE statement?
 
 SELECT * FROM foo WHERE bar LIKE %:1%
 
 I've tried the above (error), I've tried '%':1'%' (error), 
 and
 I've
 tried
 appending the % to the container I'm passing as my :1 
 (doesn't
 work).
 
 I really don't want to do this the unsafe way.
 --
 On the first day, God created the heavens and the Earth On 
 the second day, God created the oceans.
 On the third day, God put the animals on hold for a few 
 hours, and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage 
 your subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
 --
 On the first day, God created the heavens and the Earth

Re: parameterized query with wildcard

2015-07-30 Thread Peter Haworth
If you use the placeholder method, there is no need to sanitize the
strings, that's the point of using it.  Although I guess it depends on what
you mean by sanitize.

On Thu, Jul 30, 2015 at 8:11 AM Bob Sneidar bobsnei...@iotecdigital.com
wrote:

 Yes it does. If you use the placeholder method (I am not really sure what
 to call it at this point) then sqlYoga sanitizes the strings for you. I've
 inserted records with any number of characters using this method without
 any problems reading in or out of the database.

 I'm not sure if a direct query like address = '\\bobscomputer\scans' is
 sanitized. For the sake of standardization I always use the placeholder
 method.

 Bob S


  On Jul 28, 2015, at 09:17 , Andrew Kluthe and...@ctech.me wrote:
 
  Does revDataFromQuery do any sanitizing/proper to prevent me from
 sneaking
  extra SQL into your search box like an injection style attack, or does it
  just plop whatever you give in there no questions asked? Just curious. I
  have always been spoiled by SQLYoga or rolled my DB interfaces up into
 API
  servers of some kind.
 
  On Tue, Jul 28, 2015 at 11:09 AM Dave Kilroy 
 d...@applicationinsight.com
  wrote:
 
  Mike, assuming you are searching the db with parameter pSearchTerm, try
  something like this:
 
 
  put %  pSearchTerm  % into tSearchTerm
  put SELECT * FROM foo WHERE bar LIKE :1 into tQuery
  get revDataFromQuery(tab, return, sDBID, tQuery, tSearchTerm)
 
 
 
 
 
 
  -
  The difference between genius and stupidity is; genius has its
 limits. -
  Albert Einstein
  --
  View this message in context:
 
 http://runtime-revolution.278305.n4.nabble.com/parameterized-query-with-wildcard-tp4694407p4694419.html
  Sent from the Revolution - User mailing list archive at Nabble.com.
 
  ___
  use-livecode mailing list
  use-livecode@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@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: parameterized query with wildcard

2015-07-30 Thread Peter Haworth
Good questions Ralph, not sure I have definitive answers.  I do know that
even if your queries are executed by PHP scripts on your sever, there are
ways for SQL injection attacks to occur, although it's much more
complicated.  There's a good Wikipedia article on this at
https://en.wikipedia.org/wiki/SQL_injection.  There are some really scary
examples of attacks that have occurred using this method at the end of the
article.  There are a lot of bad people out there!

For my own peace of mind, I automatically use placeholders these days so I
don't have to concern myself whether I'm already protected against attacks
or not

Just saw Mark's reply while writing this which I think validates the use of
placeholders.



On Thu, Jul 30, 2015 at 11:56 AM Ralph DiMola rdim...@evergreeninfo.net
wrote:

 Peter,

 If you using an SSL connection to the DB is there still SQL injection
 risks?

 3...2...1... and Mark Wieder says Use a web service

 Then I will +1 it. I have almost completely moved to the https web service
 model for remote DB access.

 Ralph DiMola
 IT Director
 Evergreen Information Services
 rdim...@evergreeninfo.net


 -Original Message-
 From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On
 Behalf Of Peter Haworth
 Sent: Thursday, July 30, 2015 2:47 PM
 To: How to use LiveCode
 Subject: Re: parameterized query with wildcard

 I feel I should point out that you are leaving yourself wide open to SQL
 injection attacks by not using the placeholder method of passing data to
 SQL statements.  Not enough space to detail how that works here but just
 Google SQL injection on the web to see a sample of the really bad things
 that can happen.

 When you use placeholders, the SQL statement and the values in the
 placeholder variables are sent to the database separately which gives you
 full protection against SQL injection attacks.

 On Wed, Jul 29, 2015 at 10:02 AM PystCat pyst...@gmail.com wrote:

  When I get that value from the user it is scrubbed and then put into
  the SQL with the merge.
 
 
 
 
   On Jul 29, 2015, at 12:18 PM, Peter Haworth p...@lcsql.com wrote:
  
   But why bother?  You're already putting the value into a variable so
   all that's required is use :1 and append the variable name to the
   revxxx
  call.
   On Wed, Jul 29, 2015 at 8:29 AM PystCat pyst...@gmail.com wrote:
  
   Not a problem... Scrub the variable before the merge... It's what I
   do
  as
   well.  I have a function that takes the input and scrubs it... I'm
   away
  for
   another week but if you're interested, when I get back I can post
   the handler.
  
  
  
   On Jul 29, 2015, at 10:35 AM, Mike Kerner
   mikeker...@roadrunner.com
   wrote:
  
   The reason for using parameterized queries instead of either
   merging or appending is because of SQL injection.
  
   On Wed, Jul 29, 2015 at 10:18 AM, PystCat pyst...@gmail.com
 wrote:
  
   Why not just use merge...?
  
   Put John into tVal
   Put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]])) into
   pSQL OR put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]]%))
   into pSQL
  
   I do this for all of my queries and it works fine.
  
   Paul
  
  
  
  
   On Jul 29, 2015, at 9:45 AM, Mike Kerner
   mikeker...@roadrunner.com
  
   wrote:
  
   If I was guessing, my hunch would be that including the
   single-quotes
   is
   going to make the db look for strings containing %:1%, instead
   of
  using
   the
   wildcards and the parameter.
  
   On Wed, Jul 29, 2015 at 9:31 AM, Mike Kerner 
   mikeker...@roadrunner.com
   wrote:
  
   Nope.  That doesn't work, Bob.  That returns nothing.
  
   On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar 
   bobsnei...@iotecdigital.com
   wrote:
  
   Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.
  
   If you are searching for a value at the beginning, LIKE ‘:1%’
   or at
   the
   end, LIKE ‘%:1’
  
   If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’
   OR
   column
   LIKE ‘%:1’
  
   HTH
  
   Bob S
  
  
   On Jul 28, 2015, at 08:16 , Mike Kerner 
  mikeker...@roadrunner.com
  
   wrote:
  
   Has anybody built any queries that use both parameters and
   wildcards,
   e.g.
   in a LIKE statement?
  
   SELECT * FROM foo WHERE bar LIKE %:1%
  
   I've tried the above (error), I've tried '%':1'%' (error),
   and
  I've
   tried
   appending the % to the container I'm passing as my :1
   (doesn't
   work).
  
   I really don't want to do this the unsafe way.
   --
   On the first day, God created the heavens and the Earth On
   the second day, God created the oceans.
   On the third day, God put the animals on hold for a few
   hours, and did a little diving.
   And God said, This is good.
   ___
   use-livecode mailing list
   use-livecode@lists.runrev.com Please visit this url to
   subscribe, unsubscribe and manage your
   subscription preferences:
   http://lists.runrev.com/mailman/listinfo/use-livecode

Re: parameterized query with wildcard

2015-07-29 Thread PystCat
When I get that value from the user it is scrubbed and then put into the SQL 
with the merge.




 On Jul 29, 2015, at 12:18 PM, Peter Haworth p...@lcsql.com wrote:
 
 But why bother?  You're already putting the value into a variable so all
 that's required is use :1 and append the variable name to the revxxx call.
 On Wed, Jul 29, 2015 at 8:29 AM PystCat pyst...@gmail.com wrote:
 
 Not a problem... Scrub the variable before the merge... It's what I do as
 well.  I have a function that takes the input and scrubs it... I'm away for
 another week but if you're interested, when I get back I can post the
 handler.
 
 
 
 On Jul 29, 2015, at 10:35 AM, Mike Kerner mikeker...@roadrunner.com
 wrote:
 
 The reason for using parameterized queries instead of either merging or
 appending is because of SQL injection.
 
 On Wed, Jul 29, 2015 at 10:18 AM, PystCat pyst...@gmail.com wrote:
 
 Why not just use merge...?
 
 Put John into tVal
 Put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]])) into pSQL
 OR
 put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]]%)) into pSQL
 
 I do this for all of my queries and it works fine.
 
 Paul
 
 
 
 
 On Jul 29, 2015, at 9:45 AM, Mike Kerner mikeker...@roadrunner.com
 wrote:
 
 If I was guessing, my hunch would be that including the single-quotes
 is
 going to make the db look for strings containing %:1%, instead of using
 the
 wildcards and the parameter.
 
 On Wed, Jul 29, 2015 at 9:31 AM, Mike Kerner 
 mikeker...@roadrunner.com
 wrote:
 
 Nope.  That doesn't work, Bob.  That returns nothing.
 
 On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar 
 bobsnei...@iotecdigital.com
 wrote:
 
 Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.
 
 If you are searching for a value at the beginning, LIKE ‘:1%’ or at
 the
 end, LIKE ‘%:1’
 
 If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ OR
 column
 LIKE ‘%:1’
 
 HTH
 
 Bob S
 
 
 On Jul 28, 2015, at 08:16 , Mike Kerner mikeker...@roadrunner.com
 
 wrote:
 
 Has anybody built any queries that use both parameters and
 wildcards,
 e.g.
 in a LIKE statement?
 
 SELECT * FROM foo WHERE bar LIKE %:1%
 
 I've tried the above (error), I've tried '%':1'%' (error), and I've
 tried
 appending the % to the container I'm passing as my :1 (doesn't
 work).
 
 I really don't want to do this the unsafe way.
 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
 and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
 and did a little diving.
 And God said, This is good.
 
 
 
 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
 and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
  and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 

Re: parameterized query with wildcard

2015-07-29 Thread Peter Haworth
If you are specifying a literal value with LIKE, then you need the single
quotes or you will get an error.  If you are using a parameter variable
containing the literal, then no single quotes needed.  Including the :1 in
quotes makes the query look for a string containing :1, not the contents of
the variable referred to by :1.

On Wed, Jul 29, 2015 at 6:33 AM Mike Kerner mikeker...@roadrunner.com
wrote:

 Nope.  That doesn't work, Bob.  That returns nothing.

 On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar bobsnei...@iotecdigital.com
 wrote:

  Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.
 
  If you are searching for a value at the beginning, LIKE ‘:1%’ or at the
  end, LIKE ‘%:1’
 
  If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ OR column
  LIKE ‘%:1’
 
  HTH
 
  Bob S
 
 
   On Jul 28, 2015, at 08:16 , Mike Kerner mikeker...@roadrunner.com
  wrote:
  
   Has anybody built any queries that use both parameters and wildcards,
  e.g.
   in a LIKE statement?
  
   SELECT * FROM foo WHERE bar LIKE %:1%
  
   I've tried the above (error), I've tried '%':1'%' (error), and I've
 tried
   appending the % to the container I'm passing as my :1 (doesn't work).
  
   I really don't want to do this the unsafe way.
   --
   On the first day, God created the heavens and the Earth
   On the second day, God created the oceans.
   On the third day, God put the animals on hold for a few hours,
 and did a little diving.
   And God said, This is good.
   ___
   use-livecode mailing list
   use-livecode@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@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 



 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: parameterized query with wildcard

2015-07-29 Thread Peter Haworth
But why bother?  You're already putting the value into a variable so all
that's required is use :1 and append the variable name to the revxxx call.
On Wed, Jul 29, 2015 at 8:29 AM PystCat pyst...@gmail.com wrote:

 Not a problem... Scrub the variable before the merge... It's what I do as
 well.  I have a function that takes the input and scrubs it... I'm away for
 another week but if you're interested, when I get back I can post the
 handler.



  On Jul 29, 2015, at 10:35 AM, Mike Kerner mikeker...@roadrunner.com
 wrote:
 
  The reason for using parameterized queries instead of either merging or
  appending is because of SQL injection.
 
  On Wed, Jul 29, 2015 at 10:18 AM, PystCat pyst...@gmail.com wrote:
 
  Why not just use merge...?
 
  Put John into tVal
  Put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]])) into pSQL
  OR
  put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]]%)) into pSQL
 
  I do this for all of my queries and it works fine.
 
  Paul
 
 
 
 
  On Jul 29, 2015, at 9:45 AM, Mike Kerner mikeker...@roadrunner.com
  wrote:
 
  If I was guessing, my hunch would be that including the single-quotes
 is
  going to make the db look for strings containing %:1%, instead of using
  the
  wildcards and the parameter.
 
  On Wed, Jul 29, 2015 at 9:31 AM, Mike Kerner 
 mikeker...@roadrunner.com
  wrote:
 
  Nope.  That doesn't work, Bob.  That returns nothing.
 
  On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar 
  bobsnei...@iotecdigital.com
  wrote:
 
  Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.
 
  If you are searching for a value at the beginning, LIKE ‘:1%’ or at
 the
  end, LIKE ‘%:1’
 
  If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ OR
 column
  LIKE ‘%:1’
 
  HTH
 
  Bob S
 
 
  On Jul 28, 2015, at 08:16 , Mike Kerner mikeker...@roadrunner.com
 
  wrote:
 
  Has anybody built any queries that use both parameters and
 wildcards,
  e.g.
  in a LIKE statement?
 
  SELECT * FROM foo WHERE bar LIKE %:1%
 
  I've tried the above (error), I've tried '%':1'%' (error), and I've
  tried
  appending the % to the container I'm passing as my :1 (doesn't
 work).
 
  I really don't want to do this the unsafe way.
  --
  On the first day, God created the heavens and the Earth
  On the second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours,
  and did a little diving.
  And God said, This is good.
  ___
  use-livecode mailing list
  use-livecode@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@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
  --
  On the first day, God created the heavens and the Earth
  On the second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours,
   and did a little diving.
  And God said, This is good.
 
 
 
  --
  On the first day, God created the heavens and the Earth
  On the second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours,
   and did a little diving.
  And God said, This is good.
  ___
  use-livecode mailing list
  use-livecode@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@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
  --
  On the first day, God created the heavens and the Earth
  On the second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours,
and did a little diving.
  And God said, This is good.
  ___
  use-livecode mailing list
  use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: parameterized query with wildcard

2015-07-29 Thread PystCat
Not a problem... Scrub the variable before the merge... It's what I do as well. 
 I have a function that takes the input and scrubs it... I'm away for another 
week but if you're interested, when I get back I can post the handler.



 On Jul 29, 2015, at 10:35 AM, Mike Kerner mikeker...@roadrunner.com wrote:
 
 The reason for using parameterized queries instead of either merging or
 appending is because of SQL injection.
 
 On Wed, Jul 29, 2015 at 10:18 AM, PystCat pyst...@gmail.com wrote:
 
 Why not just use merge...?
 
 Put John into tVal
 Put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]])) into pSQL
 OR
 put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]]%)) into pSQL
 
 I do this for all of my queries and it works fine.
 
 Paul
 
 
 
 
 On Jul 29, 2015, at 9:45 AM, Mike Kerner mikeker...@roadrunner.com
 wrote:
 
 If I was guessing, my hunch would be that including the single-quotes is
 going to make the db look for strings containing %:1%, instead of using
 the
 wildcards and the parameter.
 
 On Wed, Jul 29, 2015 at 9:31 AM, Mike Kerner mikeker...@roadrunner.com
 wrote:
 
 Nope.  That doesn't work, Bob.  That returns nothing.
 
 On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar 
 bobsnei...@iotecdigital.com
 wrote:
 
 Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.
 
 If you are searching for a value at the beginning, LIKE ‘:1%’ or at the
 end, LIKE ‘%:1’
 
 If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ OR column
 LIKE ‘%:1’
 
 HTH
 
 Bob S
 
 
 On Jul 28, 2015, at 08:16 , Mike Kerner mikeker...@roadrunner.com
 wrote:
 
 Has anybody built any queries that use both parameters and wildcards,
 e.g.
 in a LIKE statement?
 
 SELECT * FROM foo WHERE bar LIKE %:1%
 
 I've tried the above (error), I've tried '%':1'%' (error), and I've
 tried
 appending the % to the container I'm passing as my :1 (doesn't work).
 
 I really don't want to do this the unsafe way.
 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
 and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
  and did a little diving.
 And God said, This is good.
 
 
 
 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
  and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
 -- 
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
   and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: parameterized query with wildcard

2015-07-29 Thread Bob Sneidar
How odd. I am thinking now, that because I am passing these query arguements to 
sqlYoga it is doing the macro replacement instead of SQL. Now that I think of 
it, I have never used this  in a direct SQL query. I am not even sure how to 
construct it. Is this a web server convention? I cannot see how you would 
inject the values in a direct query. 

Bob S


 On Jul 29, 2015, at 09:16 , Peter Haworth p...@lcsql.com wrote:
 
 If you are specifying a literal value with LIKE, then you need the single
 quotes or you will get an error.  If you are using a parameter variable
 containing the literal, then no single quotes needed.  Including the :1 in
 quotes makes the query look for a string containing :1, not the contents of
 the variable referred to by :1.
 
 On Wed, Jul 29, 2015 at 6:33 AM Mike Kerner mikeker...@roadrunner.com
 wrote:
 
 Nope.  That doesn't work, Bob.  That returns nothing.
 
 On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar bobsnei...@iotecdigital.com
 wrote:
 
 Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.
 
 If you are searching for a value at the beginning, LIKE ‘:1%’ or at the
 end, LIKE ‘%:1’
 
 If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ OR column
 LIKE ‘%:1’
 
 HTH
 
 Bob S
 
 
 On Jul 28, 2015, at 08:16 , Mike Kerner mikeker...@roadrunner.com
 wrote:
 
 Has anybody built any queries that use both parameters and wildcards,
 e.g.
 in a LIKE statement?
 
 SELECT * FROM foo WHERE bar LIKE %:1%
 
 I've tried the above (error), I've tried '%':1'%' (error), and I've
 tried
 appending the % to the container I'm passing as my :1 (doesn't work).
 
 I really don't want to do this the unsafe way.
 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
  and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
 
 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
   and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: parameterized query with wildcard

2015-07-29 Thread Bob Sneidar
Turns out it is done in the system settings under keyboard in case anyone else 
needs to do the same.

Bob S


On Jul 29, 2015, at 15:06 , Bob Sneidar 
bobsnei...@iotecdigital.commailto:bobsnei...@iotecdigital.com wrote:

I should also mention that my mail program *DOES* substitute plain quotes for 
smart ones. I am disabling that “feature” now.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: parameterized query with wildcard

2015-07-29 Thread Bob Sneidar
Okay I see my confusion. I can use a statement like:

select * from customers where customername LIKE '%int%’

This works. It seems however that when using parameter substitution it does 
not. In sqlYoga I can use: 

put sqlquery_createObject(“customers”) into qCustomerObject
put “customer name LIKE ‘%:1%’” into tConditions
put “int” into aBindings [1]
sqlquery_set qCustomerObject, “conditions”, tConditions
sqlquery_set qCustomerObject, “condition bindings”, aBindings
sqlquery_retrieveAsArray qCustomerObject, aCustomerData

This also works. I should also mention that my mail program *DOES* substitute 
plain quotes for smart ones. I am disabling that “feature” now. 

Bob S



 On Jul 29, 2015, at 14:35 , Bob Sneidar bobsnei...@iotecdigital.com wrote:
 
 How odd. I am thinking now, that because I am passing these query arguements 
 to sqlYoga it is doing the macro replacement instead of SQL. Now that I think 
 of it, I have never used this  in a direct SQL query. I am not even sure how 
 to construct it. Is this a web server convention? I cannot see how you would 
 inject the values in a direct query. 
 
 Bob S

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: parameterized query with wildcard

2015-07-29 Thread Bob Sneidar
If you copied and pasted it may be that the small quotes are not the right 
characters. I have used this query successfully myself so I may have mistyped 
something. 

Bob S


 On Jul 29, 2015, at 06:31 , Mike Kerner mikeker...@roadrunner.com wrote:
 
 Nope.  That doesn't work, Bob.  That returns nothing.
 
 On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar bobsnei...@iotecdigital.com
 wrote:
 
 Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.
 
 If you are searching for a value at the beginning, LIKE ‘:1%’ or at the
 end, LIKE ‘%:1’
 
 If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ OR column
 LIKE ‘%:1’
 
 HTH
 
 Bob S
 
 
 On Jul 28, 2015, at 08:16 , Mike Kerner mikeker...@roadrunner.com
 wrote:
 
 Has anybody built any queries that use both parameters and wildcards,
 e.g.
 in a LIKE statement?
 
 SELECT * FROM foo WHERE bar LIKE %:1%
 
 I've tried the above (error), I've tried '%':1'%' (error), and I've tried
 appending the % to the container I'm passing as my :1 (doesn't work).
 
 I really don't want to do this the unsafe way.
 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
  and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
 
 -- 
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
   and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: parameterized query with wildcard

2015-07-29 Thread Mike Kerner
The reason for using parameterized queries instead of either merging or
appending is because of SQL injection.

On Wed, Jul 29, 2015 at 10:18 AM, PystCat pyst...@gmail.com wrote:

 Why not just use merge...?

 Put John into tVal
 Put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]])) into pSQL
 OR
 put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]]%)) into pSQL

 I do this for all of my queries and it works fine.

 Paul




  On Jul 29, 2015, at 9:45 AM, Mike Kerner mikeker...@roadrunner.com
 wrote:
 
  If I was guessing, my hunch would be that including the single-quotes is
  going to make the db look for strings containing %:1%, instead of using
 the
  wildcards and the parameter.
 
  On Wed, Jul 29, 2015 at 9:31 AM, Mike Kerner mikeker...@roadrunner.com
  wrote:
 
  Nope.  That doesn't work, Bob.  That returns nothing.
 
  On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar 
 bobsnei...@iotecdigital.com
  wrote:
 
  Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.
 
  If you are searching for a value at the beginning, LIKE ‘:1%’ or at the
  end, LIKE ‘%:1’
 
  If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ OR column
  LIKE ‘%:1’
 
  HTH
 
  Bob S
 
 
  On Jul 28, 2015, at 08:16 , Mike Kerner mikeker...@roadrunner.com
  wrote:
 
  Has anybody built any queries that use both parameters and wildcards,
  e.g.
  in a LIKE statement?
 
  SELECT * FROM foo WHERE bar LIKE %:1%
 
  I've tried the above (error), I've tried '%':1'%' (error), and I've
  tried
  appending the % to the container I'm passing as my :1 (doesn't work).
 
  I really don't want to do this the unsafe way.
  --
  On the first day, God created the heavens and the Earth
  On the second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours,
   and did a little diving.
  And God said, This is good.
  ___
  use-livecode mailing list
  use-livecode@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@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
 
  --
  On the first day, God created the heavens and the Earth
  On the second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours,
and did a little diving.
  And God said, This is good.
 
 
 
 
  --
  On the first day, God created the heavens and the Earth
  On the second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours,
and did a little diving.
  And God said, This is good.
  ___
  use-livecode mailing list
  use-livecode@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: parameterized query with wildcard

2015-07-29 Thread Mike Kerner
If I was guessing, my hunch would be that including the single-quotes is
going to make the db look for strings containing %:1%, instead of using the
wildcards and the parameter.

On Wed, Jul 29, 2015 at 9:31 AM, Mike Kerner mikeker...@roadrunner.com
wrote:

 Nope.  That doesn't work, Bob.  That returns nothing.

 On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar bobsnei...@iotecdigital.com
 wrote:

 Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.

 If you are searching for a value at the beginning, LIKE ‘:1%’ or at the
 end, LIKE ‘%:1’

 If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ OR column
 LIKE ‘%:1’

 HTH

 Bob S


  On Jul 28, 2015, at 08:16 , Mike Kerner mikeker...@roadrunner.com
 wrote:
 
  Has anybody built any queries that use both parameters and wildcards,
 e.g.
  in a LIKE statement?
 
  SELECT * FROM foo WHERE bar LIKE %:1%
 
  I've tried the above (error), I've tried '%':1'%' (error), and I've
 tried
  appending the % to the container I'm passing as my :1 (doesn't work).
 
  I really don't want to do this the unsafe way.
  --
  On the first day, God created the heavens and the Earth
  On the second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours,
and did a little diving.
  And God said, This is good.
  ___
  use-livecode mailing list
  use-livecode@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
and did a little diving.
 And God said, This is good.




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: parameterized query with wildcard

2015-07-29 Thread PystCat
Why not just use merge...?

Put John into tVal
Put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]])) into pSQL
OR
put merge(SELECT * FROM foo WHERE(bar LIKE %[[tVal]]%)) into pSQL

I do this for all of my queries and it works fine.

Paul




 On Jul 29, 2015, at 9:45 AM, Mike Kerner mikeker...@roadrunner.com wrote:
 
 If I was guessing, my hunch would be that including the single-quotes is
 going to make the db look for strings containing %:1%, instead of using the
 wildcards and the parameter.
 
 On Wed, Jul 29, 2015 at 9:31 AM, Mike Kerner mikeker...@roadrunner.com
 wrote:
 
 Nope.  That doesn't work, Bob.  That returns nothing.
 
 On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar bobsnei...@iotecdigital.com
 wrote:
 
 Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.
 
 If you are searching for a value at the beginning, LIKE ‘:1%’ or at the
 end, LIKE ‘%:1’
 
 If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ OR column
 LIKE ‘%:1’
 
 HTH
 
 Bob S
 
 
 On Jul 28, 2015, at 08:16 , Mike Kerner mikeker...@roadrunner.com
 wrote:
 
 Has anybody built any queries that use both parameters and wildcards,
 e.g.
 in a LIKE statement?
 
 SELECT * FROM foo WHERE bar LIKE %:1%
 
 I've tried the above (error), I've tried '%':1'%' (error), and I've
 tried
 appending the % to the container I'm passing as my :1 (doesn't work).
 
 I really don't want to do this the unsafe way.
 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
  and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
 
 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
   and did a little diving.
 And God said, This is good.
 
 
 
 
 -- 
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
   and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: parameterized query with wildcard

2015-07-29 Thread Mike Kerner
Nope.  That doesn't work, Bob.  That returns nothing.

On Tue, Jul 28, 2015 at 7:23 PM, Bob Sneidar bobsnei...@iotecdigital.com
wrote:

 Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’.

 If you are searching for a value at the beginning, LIKE ‘:1%’ or at the
 end, LIKE ‘%:1’

 If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ OR column
 LIKE ‘%:1’

 HTH

 Bob S


  On Jul 28, 2015, at 08:16 , Mike Kerner mikeker...@roadrunner.com
 wrote:
 
  Has anybody built any queries that use both parameters and wildcards,
 e.g.
  in a LIKE statement?
 
  SELECT * FROM foo WHERE bar LIKE %:1%
 
  I've tried the above (error), I've tried '%':1'%' (error), and I've tried
  appending the % to the container I'm passing as my :1 (doesn't work).
 
  I really don't want to do this the unsafe way.
  --
  On the first day, God created the heavens and the Earth
  On the second day, God created the oceans.
  On the third day, God put the animals on hold for a few hours,
and did a little diving.
  And God said, This is good.
  ___
  use-livecode mailing list
  use-livecode@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: parameterized query with wildcard

2015-07-28 Thread Bob Sneidar
Should be LIKE ‘:1’ or for wild cards LIKE ‘%:1%’. 

If you are searching for a value at the beginning, LIKE ‘:1%’ or at the end, 
LIKE ‘%:1’

If searching for all, column LIKE ‘%:1%’ OR column LIKE ‘:1%’ OR column LIKE 
‘%:1’

HTH

Bob S


 On Jul 28, 2015, at 08:16 , Mike Kerner mikeker...@roadrunner.com wrote:
 
 Has anybody built any queries that use both parameters and wildcards, e.g.
 in a LIKE statement?
 
 SELECT * FROM foo WHERE bar LIKE %:1%
 
 I've tried the above (error), I've tried '%':1'%' (error), and I've tried
 appending the % to the container I'm passing as my :1 (doesn't work).
 
 I really don't want to do this the unsafe way.
 -- 
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
   and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

parameterized query with wildcard

2015-07-28 Thread Mike Kerner
Has anybody built any queries that use both parameters and wildcards, e.g.
in a LIKE statement?

SELECT * FROM foo WHERE bar LIKE %:1%

I've tried the above (error), I've tried '%':1'%' (error), and I've tried
appending the % to the container I'm passing as my :1 (doesn't work).

I really don't want to do this the unsafe way.
-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: parameterized query with wildcard

2015-07-28 Thread Dave Kilroy
Mike, assuming you are searching the db with parameter pSearchTerm, try
something like this:


put %  pSearchTerm  % into tSearchTerm
put SELECT * FROM foo WHERE bar LIKE :1 into tQuery
get revDataFromQuery(tab, return, sDBID, tQuery, tSearchTerm)






-
The difference between genius and stupidity is; genius has its limits. - 
Albert Einstein
--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/parameterized-query-with-wildcard-tp4694407p4694419.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: parameterized query with wildcard

2015-07-28 Thread Andrew Kluthe
Should have read, *proper escaping*.

On Tue, Jul 28, 2015 at 11:17 AM Andrew Kluthe and...@ctech.me wrote:

 Does revDataFromQuery do any sanitizing/proper to prevent me from sneaking
 extra SQL into your search box like an injection style attack, or does it
 just plop whatever you give in there no questions asked? Just curious. I
 have always been spoiled by SQLYoga or rolled my DB interfaces up into API
 servers of some kind.

 On Tue, Jul 28, 2015 at 11:09 AM Dave Kilroy d...@applicationinsight.com
 wrote:

 Mike, assuming you are searching the db with parameter pSearchTerm, try
 something like this:


 put %  pSearchTerm  % into tSearchTerm
 put SELECT * FROM foo WHERE bar LIKE :1 into tQuery
 get revDataFromQuery(tab, return, sDBID, tQuery, tSearchTerm)






 -
 The difference between genius and stupidity is; genius has its limits.
 - Albert Einstein
 --
 View this message in context:
 http://runtime-revolution.278305.n4.nabble.com/parameterized-query-with-wildcard-tp4694407p4694419.html
 Sent from the Revolution - User mailing list archive at Nabble.com.

 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: parameterized query with wildcard

2015-07-28 Thread Andrew Kluthe
Does revDataFromQuery do any sanitizing/proper to prevent me from sneaking
extra SQL into your search box like an injection style attack, or does it
just plop whatever you give in there no questions asked? Just curious. I
have always been spoiled by SQLYoga or rolled my DB interfaces up into API
servers of some kind.

On Tue, Jul 28, 2015 at 11:09 AM Dave Kilroy d...@applicationinsight.com
wrote:

 Mike, assuming you are searching the db with parameter pSearchTerm, try
 something like this:


 put %  pSearchTerm  % into tSearchTerm
 put SELECT * FROM foo WHERE bar LIKE :1 into tQuery
 get revDataFromQuery(tab, return, sDBID, tQuery, tSearchTerm)






 -
 The difference between genius and stupidity is; genius has its limits. -
 Albert Einstein
 --
 View this message in context:
 http://runtime-revolution.278305.n4.nabble.com/parameterized-query-with-wildcard-tp4694407p4694419.html
 Sent from the Revolution - User mailing list archive at Nabble.com.

 ___
 use-livecode mailing list
 use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: parameterized query with wildcard

2015-07-28 Thread Mike Kerner
Dave,
I take that back - I must have had a typo the first time I tried it.
Appending the wildcards to the search parameter does work.

On Tue, Jul 28, 2015 at 12:28 PM, Mike Kerner mikeker...@roadrunner.com
wrote:

 Dave, sorry, I thought I mentioned trying that.  It does not work.

 Andrew, yes, if you use a parameterized query, you do not have to
 escape/sanitize your parameters.  If you append them to build a query, you
 do.

 On Tue, Jul 28, 2015 at 12:18 PM, Andrew Kluthe and...@ctech.me wrote:

 Should have read, *proper escaping*.

 On Tue, Jul 28, 2015 at 11:17 AM Andrew Kluthe and...@ctech.me wrote:

  Does revDataFromQuery do any sanitizing/proper to prevent me from
 sneaking
  extra SQL into your search box like an injection style attack, or does
 it
  just plop whatever you give in there no questions asked? Just curious. I
  have always been spoiled by SQLYoga or rolled my DB interfaces up into
 API
  servers of some kind.
 
  On Tue, Jul 28, 2015 at 11:09 AM Dave Kilroy 
 d...@applicationinsight.com
  wrote:
 
  Mike, assuming you are searching the db with parameter pSearchTerm, try
  something like this:
 
 
  put %  pSearchTerm  % into tSearchTerm
  put SELECT * FROM foo WHERE bar LIKE :1 into tQuery
  get revDataFromQuery(tab, return, sDBID, tQuery, tSearchTerm)
 
 
 
 
 
 
  -
  The difference between genius and stupidity is; genius has its
 limits.
  - Albert Einstein
  --
  View this message in context:
 
 http://runtime-revolution.278305.n4.nabble.com/parameterized-query-with-wildcard-tp4694407p4694419.html
  Sent from the Revolution - User mailing list archive at Nabble.com.
 
  ___
  use-livecode mailing list
  use-livecode@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
and did a little diving.
 And God said, This is good.




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: parameterized query with wildcard

2015-07-28 Thread Mike Kerner
Dave, sorry, I thought I mentioned trying that.  It does not work.

Andrew, yes, if you use a parameterized query, you do not have to
escape/sanitize your parameters.  If you append them to build a query, you
do.

On Tue, Jul 28, 2015 at 12:18 PM, Andrew Kluthe and...@ctech.me wrote:

 Should have read, *proper escaping*.

 On Tue, Jul 28, 2015 at 11:17 AM Andrew Kluthe and...@ctech.me wrote:

  Does revDataFromQuery do any sanitizing/proper to prevent me from
 sneaking
  extra SQL into your search box like an injection style attack, or does it
  just plop whatever you give in there no questions asked? Just curious. I
  have always been spoiled by SQLYoga or rolled my DB interfaces up into
 API
  servers of some kind.
 
  On Tue, Jul 28, 2015 at 11:09 AM Dave Kilroy 
 d...@applicationinsight.com
  wrote:
 
  Mike, assuming you are searching the db with parameter pSearchTerm, try
  something like this:
 
 
  put %  pSearchTerm  % into tSearchTerm
  put SELECT * FROM foo WHERE bar LIKE :1 into tQuery
  get revDataFromQuery(tab, return, sDBID, tQuery, tSearchTerm)
 
 
 
 
 
 
  -
  The difference between genius and stupidity is; genius has its limits.
  - Albert Einstein
  --
  View this message in context:
 
 http://runtime-revolution.278305.n4.nabble.com/parameterized-query-with-wildcard-tp4694407p4694419.html
  Sent from the Revolution - User mailing list archive at Nabble.com.
 
  ___
  use-livecode mailing list
  use-livecode@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Regex wildcard in XML Query

2014-10-15 Thread Björnke von Gierke
I'll just leave this here: http://stackoverflow.com/a/1732454/2149933

On 09 Oct 2014, at 18:41, Peter Haworth p...@lcsql.com wrote:

 On Wed, Oct 8, 2014 at 9:12 PM, Glen Bojsza gboj...@gmail.com wrote:
 
 q
 xsi:type=xsd:patternIGD.NetDevice.\d{2}\.NetCommonInterfaceConfig./q
 
 
 Hi Glen,
 Couple of issues with using the above as a regex.
 
 The period character means any character except newline in a regex.  By
 chance it works for the string you're looking for but it really should be
 escaped with a backslash character.
 
 The \d{2} looks for two digits and you only have one digit in that
 position in the string.  If you want to allow for 1 or 2 digits, you can
 use either \d{1,2} or \d\d?
 
 So your regex would be (untested):
 
 q
 xsi:type=xsd:patternIGD\.NetDevice\.\d{1,2}\.NetCommonInterfaceConfig\./q
 
 Pete
 lcSQL Software http://www.lcsql.com
 Home of lcStackBrowser http://www.lcsql.com/lcstackbrowser.html and
 SQLiteAdmin http://www.lcsql.com/sqliteadmin.html



-- 

Use an alternative Dictionary viewer:
http://bjoernke.com/bvgdocu/

Chat with other RunRev developers:
http://bjoernke.com/chatrev/



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Regex wildcard in XML Query

2014-10-15 Thread Glen Bojsza
I think I may have given the wrong phrasing... I would say I would like to
be able to XML queries similar to what can be done by Regex (but not use
regex to do the actual query).

Basically, I have found several references where XML language supports it's
own style of regex like commands.

Since my initial posting I have found a working solution for my initial
problem but I have not been able to expand on it .

Simply by changing the line

q xsi:type=xsd:stringIGD.NetDevice.1.NetCommonInterfaceConfig./q

to

q xsi:type=xsd:*pattern*\.NetCommonInterfaceConfig./q

gives my the results I was looking for. But I still would like to go
further and be able to do a wildcard in the full string and get the same
results just because I would then be able to apply the syntax to future
problems that are not as simple as my first one.



On Wed, Oct 15, 2014 at 9:36 AM, Björnke von Gierke b...@mac.com wrote:

 I'll just leave this here: http://stackoverflow.com/a/1732454/2149933



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Regex wildcard in XML Query

2014-10-09 Thread Peter Haworth
On Wed, Oct 8, 2014 at 9:12 PM, Glen Bojsza gboj...@gmail.com wrote:

 q
 xsi:type=xsd:patternIGD.NetDevice.\d{2}\.NetCommonInterfaceConfig./q


Hi Glen,
Couple of issues with using the above as a regex.

The period character means any character except newline in a regex.  By
chance it works for the string you're looking for but it really should be
escaped with a backslash character.

The \d{2} looks for two digits and you only have one digit in that
position in the string.  If you want to allow for 1 or 2 digits, you can
use either \d{1,2} or \d\d?

So your regex would be (untested):

q
xsi:type=xsd:patternIGD\.NetDevice\.\d{1,2}\.NetCommonInterfaceConfig\./q

Pete
lcSQL Software http://www.lcsql.com
Home of lcStackBrowser http://www.lcsql.com/lcstackbrowser.html and
SQLiteAdmin http://www.lcsql.com/sqliteadmin.html
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Regex wildcard in XML Query

2014-10-08 Thread Glen Bojsza
Hello,

I am looking for any XML help that make the below query into a wild card
query.

soapenv:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:soapenv=
http://schemas.xmlsoap.org/soap/envelope/;
xmlns:urn=urn:gbadmin-api-3-1-0

   soapenv:Header/

   soapenv:Body

  urn:GetTRParameters soapenv:encodingStyle=
http://schemas.xmlsoap.org/soap/encoding/;

 id xsi:type=xsd:unsignedLong878/id

 q
xsi:type=xsd:stringIGD.NetDevice.1.NetCommonInterfaceConfig./q

  /urn:GetTRParameters

   /soapenv:Body

/soapenv:Envelope

The number 1 in the line is where I would like to do a wildcard.

q xsi:type=xsd:stringIGD.NetDevice.1.NetCommonInterfaceConfig./q


I have tried the changing the xsd:string to xsd:pattern and leave the 1 in
place and this gives the same results as the original query.

Also, using the following syntax I get the correct results but I am still
using 1 (or any number I want)

q xsi:type=xsd:patternIGD.NetDevice.\1\.NetCommonInterfaceConfig./q

But I cannot figure out the syntax to replace the 1 so it is a wild card?

q xsi:type=xsd:patternIGD.NetDevice.\d{2}\.NetCommonInterfaceConfig./q

This produces no results.

I don't know if this is a regex issue, an XML issue or both.

I welcome any and all suggestions as the alternative is to have an
incredibly slow response by having to retrieve everything.

thanks,

Glen
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode