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

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

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

Post by raccoon »

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
Developer
Posts: 16758
Joined: Fri Oct 16, 2009 11:31 pm

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

Post by void »

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
Developer
Posts: 16758
Joined: Fri Oct 16, 2009 11:31 pm

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

Post by void »

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
Developer
Posts: 16758
Joined: Fri Oct 16, 2009 11:31 pm

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

Post by void »

What about:

regex:\((\d+)\) tonumber:regular-expression-match-1:1900..1999
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

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

Post by raccoon »

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
Developer
Posts: 16758
Joined: Fri Oct 16, 2009 11:31 pm

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

Post by void »

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: 1017
Joined: Thu Oct 18, 2018 1:24 am

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

Post by raccoon »

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
Developer
Posts: 16758
Joined: Fri Oct 16, 2009 11:31 pm

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

Post by void »

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