I don't think #concatenate: works with number:

Discussion related to "Everything" 1.5 Alpha.
Post Reply
raccoon
Posts: 682
Joined: Thu Oct 18, 2018 1:24 am

I don't think #concatenate: works with number:

Post by raccoon » Tue Jan 11, 2022 5:51 am

works: (1999)
works: #concat:(,1999,)
works: #concat:<(,1999,)>

works: number:1900..1999
works: number:<1900..1999>

doesn't: #concat:(,number:1900..1999,)
doesn't: #concat:<(,number:1900..1999,)>
doesn't: #concat:<(,number:<1900..1999>,)>

void
David Carpenter (Developer)
Posts: 9325
Joined: Fri Oct 16, 2009 11:31 pm

Re: I don't think #concatenate: works with number:

Post by void » Tue Jan 11, 2022 5:58 am

I get the expected results:

#concat:(,number:1900..1999,) => (number:1900..1999)
#concat:<(,number:1900..1999,)> => (number:1900..1999)
#concat:<(,number:<1900..1999>,)> => (number:<1900..1999>)


Are you expecing the literal ( )?

preprocessor syntax is:
#concat:<arg1,arg2,arg3,...>

or

#concat(:arg1,arg2,arg3,...#):

void
David Carpenter (Developer)
Posts: 9325
Joined: Fri Oct 16, 2009 11:31 pm

Re: I don't think #concatenate: works with number:

Post by void » Tue Jan 11, 2022 6:05 am

Unfortunately, the expanded search:

(number:1900..1999)

does not match the number range you are expecting.


You could fudge this with:
regex:\(\d+\) number:1900..1999

I currently don't have a search method for finding ( + number-range + )

void
David Carpenter (Developer)
Posts: 9325
Joined: Fri Oct 16, 2009 11:31 pm

Re: I don't think #concatenate: works with number:

Post by void » Tue Jan 11, 2022 6:08 am

What about:

regex:\((\d+)\) tonumber:regular-expression-match-1:1900..1999

raccoon
Posts: 682
Joined: Thu Oct 18, 2018 1:24 am

Re: I don't think #concatenate: works with number:

Post by raccoon » Tue Jan 11, 2022 7:39 am

Right. I have been using the regex variant of this search, and wanted to explore other methods via concatenation. I am a little confused between your 3 replies above though. It does or does not work for you, to match objects with the literal string "(1975)" without quotes?

I have a proposal, and I'm curious how much this would stress the parser. What if concatenation were baked in for anything that touches the outer edges of angle brackets? For example:

<brown>fox matches "brownfox.txt" but not "brown fox.txt"
the<brown|quick>fox matches "thebrownfox.txt" or "thequickfox.txt" but not "the quick brown fox.txt"

(<number:1900..1999>) should match "brown fox (1975)" but not "brown fox 1975". but it matches neither.
(<1975>) matches "brown fox (1975).txt" just fine. "brown fox 1975.txt" is correctly ignored.

For some reason, anything that touches angle brackets <> are automatically concatenated, unless number: is being used.

void
David Carpenter (Developer)
Posts: 9325
Joined: Fri Oct 16, 2009 11:31 pm

Re: I don't think #concatenate: works with number:

Post by void » Tue Jan 11, 2022 8:51 am

It does or does not work for you, to match objects with the literal string "(1975)" without quotes?
#concat:(,number:1900..1999,) => (number:1900..1999)
#concat:<(,number:1900..1999,)> => (number:1900..1999)
#concat:<(,number:<1900..1999>,)> => (number:<1900..1999>)

The searches expand as expected, but they don't match anything. (they don't work)
number: must appear at the start of the search term.

I will look into allowing <number:1900..1999> to appear inside other text.
Thanks for the suggestion.

raccoon
Posts: 682
Joined: Thu Oct 18, 2018 1:24 am

Re: I don't think #concatenate: works with number:

Post by raccoon » Tue Jan 11, 2022 4:46 pm

Thanks. And I understand now what you mean when the pre-processor #concatenate:<> works. What I need is a post-processor, and plain jane angle-brackets should do that job for functions that support it. a<b>c. Thanks for working on this.

void
David Carpenter (Developer)
Posts: 9325
Joined: Fri Oct 16, 2009 11:31 pm

Re: I don't think #concatenate: works with number:

Post by void » Wed Jan 19, 2022 9:13 am

I'm still exploring options here...

I am experimenting with regex operators inside @ and :

for example:

@^:startwith-example

endwith-example@$:

set-example@[a-z]:

digit-example@\d+:

and maybe a new number range extension, with something like the following syntax..
@number(1990..1999):

Post Reply