Copy link to clipboard
Copied
It’s possible to find the last letter?
S E A R C H:
my ?????e
my= is a the first word in the search (may be ours, yours, any word)
?????e = is the second word where grep must detect the last letter, e.
R E S U L T S:
my eye
my fate
my shame
my aerogramme
Thanks
ps. Have a very precarious grep that only catches the condition in a word: (o)h?\b
Hi @palala fog, so you want a separate grep that will select two words my * ?
(\bmy)\s([[:alpha:]]+\b)
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Interesting! Regex engines normally won't do variable length lookbehind., but I did not know about \K before.
Not knowing anything more about the OP's requirements this seems simple and work good enough:
\S +\K\S*\K\S
Copy link to clipboard
Copied
Something was broken with my copy paste, should've been a \s+ where a space snuck in and posts cannot be edited?!
\S\s+\K\S*\K\S
Copy link to clipboard
Copied
if just paras with always 2 words:
.$
If paras with any length of words (1, 2, 3 or more):
(?:^\S+\s\S*)\K\S
(^/) The Jedi
Copy link to clipboard
Copied
hi m1b,
grep is working as it recognizes words ending in a specific letter.
Is it possible (since I didn't mention it) that the result shows the two words involved?
Tried to do it but the expression is a unity.
the idea is to catch both to make lists.
O U T P U T
my eye
my rate
thanks.
Mayhem SWE:
thanks. your grep is almost fine but doing this:
 
Copy link to clipboard
Copied
I don't understand what problem your are trying to solve, nor what the issue with my regex was.
Exactly which characters did you expect to be highlighted in your screenshot?
Is the problem that it includes punctuation (the comma)? Try something like this:
\w\s+\K\w*\K\w
Should it only have highlighted the "t" at the end of "aut" and nothing else? Try:
\w\s+\K\w*\K\w(?=.*)
Copy link to clipboard
Copied
Hi @palala fog, so you want a separate grep that will select two words my * ?
(\bmy)\s([[:alpha:]]+\b)
Copy link to clipboard
Copied
Yes, m1b. Thanks. It is perfect. Thanks also for your time.
 With Indexmatic (thanks M. Autret) it will be perfect and easy to accomplish the required lists.
***********
Dear Fringe: is our fault. We couldn't put in motion your formulae:
 **************
Hi Mayhem SWE,
Let me clarify the purpose of this grep, not clearly specified.
We need to catch groups of words that belong to a gendered idiomatic language: masculine, feminine and neuter. Concordance and genre should explain the grep's nature. Don't match and mistakes are detected.
Thanks for you ideas that helped the whole thread.