Re: Find some text characters
Using ";" as the itemdel - makes sense. I also realized both split and filter could used for this. None of these beat regex for brevity, though. Sent from my iPhone > On Jul 20, 2017, at 11:06 AM, Bob Sneidar via use-livecode > wrote: > > of if char 3 to -1 of tItem > > > Bob S > > >> On Jul 17, 2017, at 14:59 , Jonathan Lynch via use-livecode >> wrote: >> >> If the number of chars in tItem = 8 then... > > > ___ > 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: Find some text characters
of if char 3 to -1 of tItem > Bob S > On Jul 17, 2017, at 14:59 , Jonathan Lynch via use-livecode > wrote: > > If the number of chars in tItem = 8 then... ___ 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: Find some text characters
2017-07-18 6:31 GMT+02:00 Peter Bogdanoff via use-livecode < use-livecode@lists.runrev.com>: > Thierry, I ended up using your first Regex example—works great! > > It is very good to know about \p{} matches—everything from Arabic to Yi. That may come in handy later. > > Thanks, > > Peter > > Glad that you like it :) > >> function testForChinese T > >> xt > >> -- any htmltext > >> return matchText( > >> Txt > >> , "\d{5};") > >> end testForChinese > funny way to re-organize my 3 lines of code ??? Might be a Opera thing ??? should be read as: function testForChinese Txt return matchText( Txt, "\d{5};" ) end testForChinese -- 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: Find some text characters
Thierry, I ended up using your first Regex example—works great! It is very good to know about \p{} matches—everything from Arabic to Yi. That may come in handy later. Thanks, Peter > On Jul 17, 2017, at 8:54 PM, Thierry Douez via use-livecode > wrote: > > 2017-07-18 3:53 GMT+02:00 Thierry Douez : > >> >>> I want to know if this data contains Chinese characters >>> >>> Thanks for suggestions! >>> >>> Peter Bogdanoff >>> >>> >> Hi Peter, >> > > > Ok, back after my second morning coffee :) > > A better way to check for Chinese code points would be > something like that (not tested and never used myself) : > > > function testForChinese utf8Text > return matchText( utf8Text, "\p{Han}") > end testForChinese > > Of course, it won't work with htmlText, but straight with > the text of a field, assuming it's coded in UTF8 !!! > > > HTH, > > Thierry > > >> >> Mmm, not sure you'll get *only* Chinese characters, >> but at least any entity with only 5 numbers. >> >> This function returns true if find any, false otherwise: >> >> function testForChinese T >> xt >> -- any htmltext >> return matchText( >> Txt >> , "\d{5};") >> end testForChinese >> >> 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 ___ 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: Find some text characters
2017-07-18 3:53 GMT+02:00 Thierry Douez : > >> I want to know if this data contains Chinese characters >> >> Thanks for suggestions! >> >> Peter Bogdanoff >> >> > Hi Peter, > Ok, back after my second morning coffee :) A better way to check for Chinese code points would be something like that (not tested and never used myself) : function testForChinese utf8Text return matchText( utf8Text, "\p{Han}") end testForChinese Of course, it won't work with htmlText, but straight with the text of a field, assuming it's coded in UTF8 !!! HTH, Thierry > > Mmm, not sure you'll get *only* Chinese characters, > but at least any entity with only 5 numbers. > > This function returns true if find any, false otherwise: > > function testForChinese T > xt > -- any htmltext >return matchText( > Txt > , "\d{5};") > end testForChinese > > 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: Find some text characters
2017-07-17 23:40 GMT+02:00 Peter Bogdanoff via use-livecode < use-livecode@lists.runrev.com>: > Is there a easy way to do this?: > > Given this htmlText that may contain Chinese characters and/or some > horizontal tabs— > > 大胆的强 > > I want to know if this data contains Chinese characters, that is an entity > with 5 numbers between the “#” and the “;” > > Only data containing 5 numbers between the “#” and the “;” would return > true. Having ONLY " ” but not the other would return false. > > Thanks for suggestions! > > Peter Bogdanoff > > Hi Peter, Mmm, not sure you'll get *only* Chinese characters, but at least any entity with only 5 numbers. This function returns true if find any, false otherwise: function testForChinese T xt -- any htmltext return matchText( Txt , "\d{5};") end testForChinese 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: Find some text characters
Another way... just playing around Replace tab with empty in tstring Replace ";" with empty in tstring Replace "#" with empty in tstring Replace "&" with linefeed in tstring Repeat for each line tLine in tstring If the number of chars in tLine = 5 then Put tLine and linefeed after tList End if End repeat Delete char -1 of tList Sent from my iPhone > On Jul 17, 2017, at 7:50 PM, jonathandly...@gmail.com wrote: > > Another way, just for fun > > Put empty into tnums > Repeat for each char tchar in tstring > > If isnumber(tchar) = true then > Put tchar after tnums > Else if tnums <> empty then > If the number of chars in tnums = 5 then > Put tnums & linefeed after tnumlist > End if > Put empty into tnums > End if > End repeat > > This should give a list of all 5 number sets > > Sent from my iPhone > >> On Jul 17, 2017, at 6:45 PM, dunbarx via use-livecode >> wrote: >> >> This cries out for regex. >> >> Thierry? >> >> >> >> -- >> View this message in context: >> http://runtime-revolution.278305.n4.nabble.com/Find-some-text-characters-tp4717138p4717143.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: Find some text characters
Another way, just for fun Put empty into tnums Repeat for each char tchar in tstring If isnumber(tchar) = true then Put tchar after tnums Else if tnums <> empty then If the number of chars in tnums = 5 then Put tnums & linefeed after tnumlist End if Put empty into tnums End if End repeat This should give a list of all 5 number sets Sent from my iPhone > On Jul 17, 2017, at 6:45 PM, dunbarx via use-livecode > wrote: > > This cries out for regex. > > Thierry? > > > > -- > View this message in context: > http://runtime-revolution.278305.n4.nabble.com/Find-some-text-characters-tp4717138p4717143.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: Find some text characters
This cries out for regex. Thierry? -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Find-some-text-characters-tp4717138p4717143.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: Find some text characters
Could replace tab with empty first, if the tabs do not matter in the final product I imagine LC provides many ways to do this :) Sent from my iPhone > On Jul 17, 2017, at 6:20 PM, Niggemann, Bernd via use-livecode > wrote: > > > Given this htmlText that may contain Chinese characters and/or some horizontal > tabs— > > 大胆的强 > > I want to know if this data contains Chinese characters, that is an entity > with > 5 numbers between the “#” and the “;” > > > > > according to google-translate this means "bold and strong" > > maybe this is a way? > > > set the htmlText of field 1 to > " 大胆的强" > > put the number of truewords of field 1 into field 2 > > set the itemDelimiter to tab > > put cr & the number of items of field 1 after field 2 > > still doesn't tell you if is numbers or not though > > Kind regards > Bernd > > ___ > 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: Find some text characters
Given this htmlText that may contain Chinese characters and/or some horizontal tabs— 大胆的强 I want to know if this data contains Chinese characters, that is an entity with 5 numbers between the “#” and the “;” according to google-translate this means "bold and strong" maybe this is a way? set the htmlText of field 1 to " 大胆的强" put the number of truewords of field 1 into field 2 set the itemDelimiter to tab put cr & the number of items of field 1 after field 2 still doesn't tell you if is numbers or not though Kind regards Bernd ___ 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: Find some text characters
If the number of chars in tItem = 8 then... You always have three extra chars, so that should be right. If you need an itemdelimiter, use "&" and check if the number of chars in each item = 7 Sent from my iPhone > On Jul 17, 2017, at 5:40 PM, Peter Bogdanoff via use-livecode > wrote: > > Is there a easy way to do this?: > > Given this htmlText that may contain Chinese characters and/or some > horizontal tabs— > > 大胆的强 > > I want to know if this data contains Chinese characters, that is an entity > with 5 numbers between the “#” and the “;” > > Only data containing 5 numbers between the “#” and the “;” would return true. > Having ONLY " ” but not the other would return false. > > Thanks for suggestions! > > Peter Bogdanoff > ___ > 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
Find some text characters
Is there a easy way to do this?: Given this htmlText that may contain Chinese characters and/or some horizontal tabs— 大胆的强 I want to know if this data contains Chinese characters, that is an entity with 5 numbers between the “#” and the “;” Only data containing 5 numbers between the “#” and the “;” would return true. Having ONLY " ” but not the other would return false. Thanks for suggestions! Peter Bogdanoff ___ 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