On Sun, Jun 4, 2017 at 1:45 PM, hh via use-livecode <
use-livecode@lists.runrev.com> wrote:
> Your "ie" is not true. So what do you want?
Regexp is red,
my face turneth blue.
My heart is now shattered,
For my "ie" ie is untrue.
:)
--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_
If the number of comma-delimited and tab-delimited elements is always
the same, I would replace all commas with tabs and then filter to have
item x having value of y.
Robert
On 5 Jun 2017, at 15:23, Paul Dupuis via use-livecode wrote:
Thank you Thierry and everyone else.
I should have reali
@Paul,
to defend you, it's not always so obvious to know what we can or cannot do
with regex.
@Mike
yes, Perl is great and that's certainly why I have embeded Perl in
LiveCode, Mmm, more than 10 years ago.
I've also helped some well known LiveCoders to do some complex
transformation with Perl wh
Thank you Thierry and everyone else.
I should have realized that I couldn't do this entirely with regex due
to the need to compare the number values. It was a long day yesterday
and my brain just wasn't in full gear.
-- Paul
On 6/5/2017 4:06 AM, Thierry Douez via use-livecode wrote:
> Hi Paul,
Wow, the perl way is pretty darn cool.
On Mon, Jun 5, 2017 at 2:06 AM, Thierry Douez via use-livecode <
use-livecode@lists.runrev.com> wrote:
> Hi Paul,
>
>
> AFAIK you need to deal with an hybrid approach (regex + livecode)
>
> So, here is one way to do it:
>
>
>put 3 into pPage
>
>repea
Hi Paul,
AFAIK you need to deal with an hybrid approach (regex + livecode)
So, here is one way to do it:
put 3 into pPage
repeat for each line T in tCiCData
if matchText( T, "(?x) \t (\d+) , \d+ , (\d+) , \d+ \z", n1, n2)
then
if (n1 <= pPage) and (n2 >= pPage) then
When I'm fighting a regex, I go to http://pythex.org/
On Sun, Jun 4, 2017 at 2:11 PM, Mike Bonner via use-livecode <
use-livecode@lists.runrev.com> wrote:
> Not sure regex can do what you want, or if it can its far far over my
> head. Would it work instead to use lc script to parse?
> If you rep
Forget it. I'm wrong, it's too late. Sorry.
> hh wrote:
> [a] all lines starting on page 2 OR ending on page 2 OR containing page 2
> ie
> (pPage >= starting page) OR (pPage <= ending page)
>
> [b] all lines starting on page 2 AND ending on page 2
> ie
> (pPage >= starting page) AND (pPage <= end
Your "ie" is not true. So what do you want?
[a] all lines starting on page 2 OR ending on page 2 OR containing page 2
ie
(pPage >= starting page) OR (pPage <= ending page)
[b] all lines starting on page 2 AND ending on page 2
ie
(pPage >= starting page) AND (pPage <= ending page)
> Paul D. wrot
Not sure regex can do what you want, or if it can its far far over my
head. Would it work instead to use lc script to parse?
If you repeat through your data (each line form, with tLine as the current
line and pPage as the page to be looked for...) you can use a one liner
like this to build a list
I have a tab and cr delimited table of data, a sample line of which is
below:
1Test4052,125941,4052,3,2388
The last tab delimited item "1,4052,3,2388" is actually ,,,
So the starting page number is 1 and ending page is 3
I have a variable pPage which contain a page number, say "2"
My regex fil
Hi Thierry,
I might have missed it but did you publish your Regex2 to the list?
Pete
On Wed, Feb 3, 2016 at 12:07 PM Richard Gaskin
wrote:
> Thierry Douez write:
>
> >> Regex has been around a long time
> >> and lots of smart computer science types has
> >> spent time coming up with ways to o
Thierry Douez write:
Regex has been around a long time
and lots of smart computer science types has
spent time coming up with ways to optimize its performance for pattern
matching.
That's was true, it's still true and will always be true!
It's true that there are almost always ways to imp
On Wed, Feb 3, 2016 at 11:53 AM Bernard Devlin wrote:
> One of the things we had in LC5 which was phenomenally fast, was searching
> through the styledText of a field. That fast way of searching particular
> text structures got lost in the migration to LC8.
Could you expand on this a little? I'm
There's huge differences in how regex implementations perform in different
> languages. For example: http://raid6.com.au/~onlyjob/posts/arena/
>
Last year, I did some experiments:
I had a 100 lines of LiveCode with a bunch of really big Regex.
It took 120 seconds on my Macbook to run.
I tried
On 03/02/2016 11:53, Bernard Devlin wrote:
Perl outperforms everything in that test. I've never assumed that LC's
"perl compatiable regex library" is going to perform at the speed which
actual Perl performs. I've always assumed that being "perl compatible" just
meant that all syntactically-correc
Hi Mark,
There's huge differences in how regex implementations perform in different
languages. For example: http://raid6.com.au/~onlyjob/posts/arena/
Perl outperforms everything in that test. I've never assumed that LC's
"perl compatiable regex library" is going to perform at the speed which
actu
> Regex has been around a long time
> and lots of smart computer science types has
> spent time coming up with ways to optimize its performance for pattern
> matching.
That's was true, it's still true and will always be true!
and here are some benchmarks
done in a late rainy sunday evening
Paul Dupuis wrote:
> Wow. I would not have expected such a significant difference. Regex
> has been around a long time and lots of smart computer science types
> has spent time coming up with ways to optimize its performance for
> pattern matching. I assumed (falsely) that regex based filters in L
On 01/30/2016 04:28 PM, Paul Dupuis wrote:
1) wondering if LC's hooks to whatever regex tool they are using under
the hood is a good as it should be
LC's regex library is the same PCRE library everyone else uses. And it's
the latest released version. Regex's power lies in its ability to match
Wow. I would not have expected such a significant difference. Regex has
been around a long time and lots of smart computer science types has
spent time coming up with ways to optimize its performance for pattern
matching. I assumed (falsely) that regex based filters in LC would be on
par or even su
end repeat
delete last char of tNuList
return tNuList
end foo3
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
ambassa...@fourthworld.com
Never mind. Solved it.
It was the pattern for the 2nd format. Fixed with
"(.+\t"&pPage&",\d+,\d+,\d+)|(.+\t\d+,\d+,"&pPage&",\d+)|(.+\t"&pPage&",\d*\.?\d*,\d*\.?\d*,\d*\.?\d*,\d*\.?\d*)"
On 1/30/2016 3:17 PM, Paul Dupuis wrote:
I need some regex help.
I have a list that is of the form:
i.e.
1Testing1,7471,1,1,747
2Testing752,18001,752,1,1800
3Testing5398,58462,320,2,768
4Testing3,111.951,683.915,302.268,385.751
3,111.951,683.915,302.268,385.751
can have a list of number
Hi Skip,
Not sure what can come before /after the string but here's a start
.*/point-.*-landed\.html.*
That will find your string with any number of chars before or after it. If
you need to check for it at the start of a line, replace ".*" with a "^" at
the start of the regexp.
Pete
lcSQL Softw
Michael, those are two awesome resources! Thanks.
SKIP
On Fri, Sep 26, 2014 at 7:23 PM, Michael Doub wrote:
> Guys, I have been using these 2 sites lately and they are really a huge
> help in understanding regex:
>
> http://regex101.com/#pcre
> http://www.regexr.com
>
> Give them a try…
> Mi
Guys, I have been using these 2 sites lately and they are really a huge help in
understanding regex:
http://regex101.com/#pcre
http://www.regexr.com
Give them a try…
Mike
On Sep 26, 2014, at 5:34 PM, Magicgate Software - Skip Kimpel
wrote:
> Thank you Mark!
>
> On Fri, Sep 26, 2014 at
Thank you Mark!
On Fri, Sep 26, 2014 at 4:58 PM, Mark Schonewille <
m.schonewi...@economy-x-talk.com> wrote:
> Hi Skip,
>
> If it contains numbers and letters, it could be
>
> /point-item[0-9a-zA-Z]+-landed.html
>
> and if it contains anything except whitespace, it could be
>
> /point-item[\w]+-l
Hi Skip,
If it contains numbers and letters, it could be
/point-item[0-9a-zA-Z]+-landed.html
and if it contains anything except whitespace, it could be
/point-item[\w]+-landed.html
Both options work with the sample data you provided.
--
Best regards,
Mark Schonewille
Economy-x-Talk Consult
Sorry... it contains letters. Sorry for the confusion. I should have been
more complete with my explanation and sample data.
SKIP
On Fri, Sep 26, 2014 at 4:51 PM, Mark Schonewille <
m.schonewi...@economy-x-talk.com> wrote:
> Then what exactly does the middle item contain? Numbers and letters?
Then what exactly does the middle item contain? Numbers and letters?
Special symbols? Chinese?
--
Best regards,
Mark Schonewille
Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553
Installer Maker for
The middle item "X" does not always have a number in it. The common
denominator between all the items I WANT to keep start with "page-" and end
with "-landed.html"
On Fri, Sep 26, 2014 at 4:37 PM, Mark Schonewille <
m.schonewi...@economy-x-talk.com> wrote:
> Hi,
>
> Then you can try this:
>
Hi,
Then you can try this:
on mouseUp
put "/point-item[0-9]+-landed.html" into myFilter
put fld 1 into myData
filter myData with regex pattern myFilter
put myData
end mouseUp
This is a LiveCode example, but you can apply the regex
"/point-item[0-9]+-landed.html" in PHP or P
Thanks Mark,
Actually look for the regex version as I will be applying that externally
before feeding into LC. Here is a sample of the data:
/point-item1-landed.html
/point-about.html
/point-test.html
/point-item2-landed.html
/point-item300-landed.html
The results I want returned are:
/point-ite
Hi,
It could be something like this:
on mouseUp
put "*/point-*-landed.html" into myFilter
put fld 1 into myData
filter myData without myFilter
put myData
end mouseUp
but if this doesn't work, you'll have to post an actual sample of your data.
--
Best regards,
Mark Schonewi
Hey LC / Regex gurus,
I need help creating a regular expression that will filter out all
instances where the pattern looks like this:
/point-XXX-landed.html
Obviously the "XX" section varies from item to item and is also of
different character lengths.
Anybody willing to give this a sho
Your training is almost complete. Destroy Darth Vader and take his place at my
side! Mooo haah haah haha hahah ahah!
Bob
On Feb 9, 2012, at 12:24 PM, Klaus on-rev wrote:
> So with this text above in tText and "tag2" int tTag:
>
> function mk_getXMLdata tText, tTag
> get matchText(tText,
Hi friends,
thank you all for your help, i got it to work now!
Again thanks a lot!
Best
Klaus
--
Klaus Major
http://www.major-k.de
kl...@major.on-rev.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe,
On Thu, Feb 9, 2012 at 7:10 PM, Klaus on-rev wrote:
> Hi Andre,
>
> Am 09.02.2012 um 22:05 schrieb Andre Garzia:
>
> > Klaus,
> >
> > Since you have control, then instead of RegEx, you can go like
> >
> >
> > nodecontent
> >
> >
> > All in different lines, then, you can just use lineOffset to f
>> Nonetheless, if you want to continue down the regex path, try
>> something like
>>
>> get matchText(tText,"(?s)<" & tTag & ">(.*?)",tValue)
>> replace "<" & tTag & ">" & tValue " with
>> "<" & tTag & ">" & tNewValue "
>> in tText
>
> well, I did not want to pass the text that I want to overwri
On 09/02/2012 21:00, Klaus on-rev wrote:
get matchText(tText,"(?s)<"& tTag& ">(.*?)",tValue)
replace "<"& tTag& ">"& tValue" with
"<"& tTag& ">"& tNewValue"
in tText
well, I did not want to pass the text that I want to overwrite in the XML,
which I do not now in that moment!
But thi
Hi Andre,
Am 09.02.2012 um 22:05 schrieb Andre Garzia:
> Klaus,
>
> Since you have control, then instead of RegEx, you can go like
>
>
> nodecontent
>
>
> All in different lines, then, you can just use lineOffset to find the start
> node and the end node and copy or replace the data between
Klaus,
Since you have control, then instead of RegEx, you can go like
nodecontent
All in different lines, then, you can just use lineOffset to find the start
node and the end node and copy or replace the data between those lines. It
is easier than RegEx.
On Thu, Feb 9, 2012 at 6:54 PM, Klaus
Hi guys,
Am 09.02.2012 um 21:52 schrieb Mark Wieder:
> Klaus,
>
> What Andre said.
Sigh... :-)
> Nonetheless, if you want to continue down the regex path, try
> something like
>
> get matchText(tText,"(?s)<" & tTag & ">(.*?)",tValue)
> replace "<" & tTag & ">" & tValue " with
> "<" & tTag &
Hi Andre,
Am 09.02.2012 um 21:38 schrieb Andre Garzia:
> Klaus,
>
> I used to work like that, doing little XML files with RegEx and matchText.
> After working like that for a long time, I came to realize that there was
> no advantage at all in my case. It was simpler to work with RevXML. The
> p
Klaus,
What Andre said. Nonetheless, if you want to continue down the regex path, try
something like
get matchText(tText,"(?s)<" & tTag & ">(.*?)",tValue)
replace "<" & tTag & ">" & tValue " with
"<" & tTag & ">" & tNewValue "
in tText
--
Mark Wieder
_
On 09/02/2012 20:24, Klaus on-rev wrote:
in my current project I need to deal with VERY small XML files
with maybe up to 20 entries.
Wait, didn't we just hear that you can't parse html (or XML) with
regexps? *grin*
function mk_getXMLdata tText, tTag
get matchText(tText,"(?s)<"& tTag&
Klaus,
I used to work like that, doing little XML files with RegEx and matchText.
After working like that for a long time, I came to realize that there was
no advantage at all in my case. It was simpler to work with RevXML. The
problem with RegEx is all the little cases where it fails. I think you
Hi friends,
in my current project I need to deal with VERY small XML files
with maybe up to 20 entries.
So using the XML external seems to be a bit overkill.
Some time ago I found a little reg ex here on the list which I turned
into a function and will return me everything inside of a given XML
49 matches
Mail list logo