Hi!
I use an and grep to play Scrabble and other word games because it helps me practice regexes, or, as my friends would say, because I'm a cheater.
Anyway, I'm trying to work out how to write a regex that might do what I want, so let's see if I can explain it properly. Let's say we want to play down. We have a letter, F, followed by three spaces, then a D, which is at the end of the board. The space below the F is a DW, so we want to play it, if possible. We have plenty of room above the F, but we can only play two spaces below F if we can't use the D, three if we can use the D. I have attached a screen-shot of the board if you're having a hard time visualizing it. I have already played "famed."
So, here's the regex I tried:
We anagram my rack, plus the F and D, and pipe it to grep. Here we're saying we can have one to three characters after the F, and the D can be there or not. While it returns many usable results, it also returns results which ignore the D. For instance:
which can't be used because you'd have "fardd" or "farmd", and so on.
Perhaps you are thinking, "Why not just ignore the four-letter words it returns?" And certainly I could pipe it to grep one more time to eliminate them, but I want to know if I can do it all in one grep ERE.
I've tried it a few different ways, but can't quite work it out:
returns identical results.
What do you think? Is it possible?
I'm trying to get some exclusions into our sendmail regular expression for the K command. The following configuration & regex works:
LOCAL_CONFIG
#
Kcheckaddress regex -a@MATCH
+<@+?\.++?\.(us|info|to|br|bid|cn|ru)
LOCAL_RULESETS
SLocal_check_mail
# check address against various regex... (0 Replies)
I am not a big expert in regex and have just little understanding of that language.
Could you help me to understand the regular Perl expression:
^(?!if\b|else\b|while\b|)(?:+?\s+){1,6}(+\s*)\(*\) *?(?:^*;?+){0,10}\{
------
This is regex to select functions from a C/C++ source and defined in... (2 Replies)
Hello everyone,
I've been struggling with an assignement for school for quite some time now and I decided to make a thread here. The goal of the script is to return all the words that can be created with a certain combination of letters that can be given as an argument for the shellscript. It's... (1 Reply)
I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly:
if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)