Re: Regex brain failure...

2024-02-03 Thread Paul Dupuis via use-livecode
https://regex101.com/ is exactly the site I ended up using. The step 
through debugger is perfect for fining where a particular pattern fails. 
It's what let me see there was a tab space tab where I expected a single 
tab in the data and correct teh regex for the data as it actually is.


On 2/3/2024 7:04 PM, Kaveh Bazargan wrote:
For testing regex you might find it useful to use regex101. It's 
excellent and you can save the page. I put your text here 
 just for testing. pls note your tabs 
are corrupted in the email and I put an "a" to make it work just for test.


On Sat, 3 Feb 2024 at 21:13, Paul Dupuis via use-livecode 
 wrote:


Never mind.

The correct pattern is: ^\d+?\t.\tnontraditional
field\tText\t2,319\tInterview 1\.txt$

There is a column with a space in it between the number column (1st
column) and the 3rd column (which I thought was the 2nd column)
that has
the code name in it (ie. nontradtional field). Now to figure out why
that is!

On 2/3/2024 1:36 PM, Paul Dupuis via use-livecode wrote:
> I have a (reduced) example set of data in a variable
"tCaseCodes" that
> is tab delimited set of lines below:
>
> 1         I am making a high salary    Text    2,319  Interview
1.txt
> 2         nontraditional field    Text    2,319  Interview 1.txt
> 3         gets married and stays married    Text  453,561
 Interview
> 1.txt
> 4         wants kids    Text    927,1009    Interview 1.txt
> 5         leaves work when kids born doesn't return  Text
>  1012,1609    Interview 1.txt
> 6         takes major responsibility for family work  Text
>  1012,1609    Interview 1.txt
>
> I have a Regex pattern in the variable "tCodeToMatch" shown below:
>
> ^\d+\tnontraditional field\tText\t2,319\tInterview 1.txt$
>
> I am executing the line of livecode script:
>
> filter lines of tCaseCodes with regex tCodeToMatch into tDuplicates
>
> The variable tDuplicates should then contain:
>
> 2         nontraditional field    Text    2,319  Interview 1.txt
>
> But is instead, empty.
>
> Clearly, I must have made a Regex pattern mistake, but I am not
seeing
> it. It is ^(start of line) \d+(any number of digits) \t(tab)
> nontraditional field  \t(tab) Text  \t(tab) 2,319 \t(tab) Interview
> 1.txt $(end of line)
>
> I thought that the period in the file name (Interview 1.txt) may
have
> been an issue as period is a reserved regex character to match a
> single character. However, I get the same empty result if I
escape the
> period, so it must be something else. I believe \d+ gets me an
integer
> as the number in this column could be several digits long.
>
> A second set of regex eyes would be appreciated.
>
> ___
> 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



--
Kaveh Bazargan PhD
Director
River Valley Technologies  ● Twitter 
 ● LinkedIn 
● ORCID 
 ● @kaveh1000@mastodon.social 


*Accelerating the Communication of Research*
* 
https://rivervalley.io/gigabyte-wins-the-alpsp-scholarly-publishing-innovation-award-using-river-valleys-publishing-technology/ 


*

___
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 brain failure...

2024-02-03 Thread Kaveh Bazargan via use-livecode
For testing regex you might find it useful to use regex101. It's excellent
and you can save the page. I put your text here
 just for testing. pls note your tabs are
corrupted in the email and I put an "a" to make it work just for test.

On Sat, 3 Feb 2024 at 21:13, Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Never mind.
>
> The correct pattern is: ^\d+?\t.\tnontraditional
> field\tText\t2,319\tInterview 1\.txt$
>
> There is a column with a space in it between the number column (1st
> column) and the 3rd column (which I thought was the 2nd column) that has
> the code name in it (ie. nontradtional field). Now to figure out why
> that is!
>
> On 2/3/2024 1:36 PM, Paul Dupuis via use-livecode wrote:
> > I have a (reduced) example set of data in a variable "tCaseCodes" that
> > is tab delimited set of lines below:
> >
> > 1 I am making a high salaryText2,319Interview 1.txt
> > 2 nontraditional fieldText2,319Interview 1.txt
> > 3 gets married and stays marriedText453,561  Interview
> > 1.txt
> > 4 wants kidsText927,1009Interview 1.txt
> > 5 leaves work when kids born doesn't returnText
> >  1012,1609Interview 1.txt
> > 6 takes major responsibility for family workText
> >  1012,1609Interview 1.txt
> >
> > I have a Regex pattern in the variable "tCodeToMatch" shown below:
> >
> > ^\d+\tnontraditional field\tText\t2,319\tInterview 1.txt$
> >
> > I am executing the line of livecode script:
> >
> > filter lines of tCaseCodes with regex tCodeToMatch into tDuplicates
> >
> > The variable tDuplicates should then contain:
> >
> > 2 nontraditional fieldText2,319Interview 1.txt
> >
> > But is instead, empty.
> >
> > Clearly, I must have made a Regex pattern mistake, but I am not seeing
> > it. It is ^(start of line) \d+(any number of digits) \t(tab)
> > nontraditional field  \t(tab) Text  \t(tab) 2,319  \t(tab) Interview
> > 1.txt $(end of line)
> >
> > I thought that the period in the file name (Interview 1.txt) may have
> > been an issue as period is a reserved regex character to match a
> > single character. However, I get the same empty result if I escape the
> > period, so it must be something else. I believe \d+ gets me an integer
> > as the number in this column could be several digits long.
> >
> > A second set of regex eyes would be appreciated.
> >
> > ___
> > 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
>


-- 
Kaveh Bazargan PhD
Director
River Valley Technologies  ● Twitter
 ● LinkedIn
 ● ORCID
 ● @kaveh1000@mastodon.social

*Accelerating the Communication of Research*

*

 [image:
https://rivervalley.io/gigabyte-wins-the-alpsp-scholarly-publishing-innovation-award-using-river-valleys-publishing-technology/]
*
___
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 brain failure...

2024-02-03 Thread Paul Dupuis via use-livecode

Never mind.

The correct pattern is: ^\d+?\t.\tnontraditional 
field\tText\t2,319\tInterview 1\.txt$


There is a column with a space in it between the number column (1st 
column) and the 3rd column (which I thought was the 2nd column) that has 
the code name in it (ie. nontradtional field). Now to figure out why 
that is!


On 2/3/2024 1:36 PM, Paul Dupuis via use-livecode wrote:
I have a (reduced) example set of data in a variable "tCaseCodes" that 
is tab delimited set of lines below:


1         I am making a high salary    Text    2,319    Interview 1.txt
2         nontraditional field    Text    2,319    Interview 1.txt
3         gets married and stays married    Text    453,561  Interview 
1.txt

4         wants kids    Text    927,1009    Interview 1.txt
5         leaves work when kids born doesn't return    Text 
 1012,1609    Interview 1.txt
6         takes major responsibility for family work    Text 
 1012,1609    Interview 1.txt


I have a Regex pattern in the variable "tCodeToMatch" shown below:

^\d+\tnontraditional field\tText\t2,319\tInterview 1.txt$

I am executing the line of livecode script:

filter lines of tCaseCodes with regex tCodeToMatch into tDuplicates

The variable tDuplicates should then contain:

2         nontraditional field    Text    2,319    Interview 1.txt

But is instead, empty.

Clearly, I must have made a Regex pattern mistake, but I am not seeing 
it. It is ^(start of line) \d+(any number of digits) \t(tab) 
nontraditional field  \t(tab) Text  \t(tab) 2,319  \t(tab) Interview 
1.txt $(end of line)


I thought that the period in the file name (Interview 1.txt) may have 
been an issue as period is a reserved regex character to match a 
single character. However, I get the same empty result if I escape the 
period, so it must be something else. I believe \d+ gets me an integer 
as the number in this column could be several digits long.


A second set of regex eyes would be appreciated.

___
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


Regex brain failure...

2024-02-03 Thread Paul Dupuis via use-livecode
I have a (reduced) example set of data in a variable "tCaseCodes" that 
is tab delimited set of lines below:


1         I am making a high salary    Text    2,319    Interview 1.txt
2         nontraditional field    Text    2,319    Interview 1.txt
3         gets married and stays married    Text    453,561  Interview 1.txt
4         wants kids    Text    927,1009    Interview 1.txt
5         leaves work when kids born doesn't return    Text  1012,1609   
 Interview 1.txt
6         takes major responsibility for family work    Text 
 1012,1609    Interview 1.txt


I have a Regex pattern in the variable "tCodeToMatch" shown below:

^\d+\tnontraditional field\tText\t2,319\tInterview 1.txt$

I am executing the line of livecode script:

filter lines of tCaseCodes with regex tCodeToMatch into tDuplicates

The variable tDuplicates should then contain:

2         nontraditional field    Text    2,319    Interview 1.txt

But is instead, empty.

Clearly, I must have made a Regex pattern mistake, but I am not seeing 
it. It is ^(start of line) \d+(any number of digits) \t(tab) 
nontraditional field  \t(tab) Text  \t(tab) 2,319  \t(tab) Interview 
1.txt $(end of line)


I thought that the period in the file name (Interview 1.txt) may have 
been an issue as period is a reserved regex character to match a single 
character. However, I get the same empty result if I escape the period, 
so it must be something else. I believe \d+ gets me an integer as the 
number in this column could be several digits long.


A second set of regex eyes would be appreciated.

___
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