Email Regular Expressions
How to validate an email address using a regular expression?
If column matches another file, print every line with match (awk/grep) I’m taking two input files, one with certain ID numbers, and another with a large list of ID numbers and additional columns. The latter file contains multiple lines for each ID number and I need to extract all lines that match an ID from the first file. Those lines then must be printed in a new file.  Edit 1: Replaced sample files with excerpts from actual  Edit 2: Removed extra spaces that were in excerpt, but not actual file. Files likely need to be sanitized in some way, but how is unclear.  file1:  AT1G56430 AT3G55190 AT3G22880   file2:  AT1G01010|GO:0043090|RCA AT1G56430|GO:0010233|IGI  AT1G56430|GO:0009555|IGI  AT1G56430|GO:0030418|IGI   expected output  AT1G56430|GO:0010233|IGI  AT1G56430|GO:0009555|IGI  AT1G56430|GO:0030418|IGI   [[  I have tried:  awk -F'|' 'NR==FNR{c[$1$2]++;next};c[$1$2] &gt; 0' file1 file2 &gt; output.txt   and:  grep -Ff file2 file1 &gt; output.txt   I’m aware that there are many somewhat similar questions posted in these forums and others. However, these don’t mention how the output is handled… nor do they mention duplicates. I’ve tried solutions from 4 of them, have been messing with this for many hours and keep getting the same problem: a blank output file.   I’m new to awk and I greatly appreciate the help. Sorry if this is a simple problem with syntax etc; please let me know. Thanks for the help. Driver locked memory on a non-virtual machine How to open and convert CHM documents? I have some documents that are in a .chm format. I wondered if there is a file format that can be easier to navigate, supported and of equal file size in Ubuntu?  If there is, I would like to start converting all those books and probably using them with less hassle on all my Ubuntu PCs and my Android phone. JavaScript: getting ImageData without canvas Tweaking AStar to find closest location to unreachable destination I've implemented AStar in Java and it works ok for an area with obstacles where the chosen destination is reachable.  However, when the destination is unreachable, the calculated "path" is in no way to the closest location (to the unreachable location) but is instead some random path.  Is there a feasible way to tweak AStar into finding the path to the closest location to an unreachable destination? How do I wrap a macro definition in an environment? I'm creating a style file, and want to store the body text of the abstract environment so that I can put it on my custom titlepage. I could have required that my users enter the abstract as  \customabstract{Abstract text goes here}`   which I would have implemented as something like  \newcommand{\customabstract}[1]{\gdef\abstracttext{#1}}   However, I would prefer that the user is able to use environment notation,  \begin{customabstract}Abstract text goes here\end{customabstract}   To do this, I thought I could define something like  \newenvironment{customabstract}{\gdef\abstracttext\bgroup}{\egroup}   But this definition makes \abstracttext expand to \bgroup, which is not what I wanted. I tried to solve the problem by \expandafter,  \newenvironment{customabstract}{\expandafter\gdef\expandafter\abstracttext\bgroup}{\egroup}   but this results in a runaway error.  Is there any way to acheive what I want? Answers that helps me understand the inner workings of TeX (instead of just referring to a custom package) are preferred. Why do I get more satisfaction out of participating in SO than out of my job? Alternatively, are there good ways to get more satisfaction out of my job, possibly by leveraging my participation in SO? What happens to the Windows 7 key when upgrading to Windows 8? Microsoft is offering "Microsoft Windows 8 Professional Upgrade" at a discounted price compared to the OEM version. However it states:     If you currently have a personal computer running Windows 7, Windows XP or Windows Vista then you can upgrade to Windows 8 Pro (Professional).   My question is what happens to the Windows 7 key that I use to upgrade? Will it become the Windows 8 key or will it generate a new Windows 8 key?  Basically if I upgrade using my Windows 7 key from my laptop for my desktop will I be able to continue using the laptop on Windows 7 while concurrently using Windows 8 upgrade on my Desktop? What is the maximum convergent $x$ in the power tower $x^{x^{x^{x\cdots}}}$? In the power tower $x^{x^{x^{x\cdots}}}$ where there is an infinite stack of $x$'s, what is the maximum convergent number? I know the answer by playing with the form $x^y=y$ and using Mathematica, but I don't know how to solve this by hand. Force refresh view in LWC In Aura, we can do      $A.get('e.force:refreshView').fire();   to cause standard components to update.  How can we do an equivalent in LWC because sfdx refuses to publish .js code with $A in it saying the usage is disallowed in LWC?  For now i tricked it with   eval("$A.get('e.force:refreshView').fire();");   but that is obviously less than ideal.... Live USB for installation does not boot, black error screen followed by visual artifacts on a purple screen Global setting of spacing between items in itemize environment for beamer What is the purpose of the bin directory? What are some examples? Minecraft pocket edition restoring skin problem I updated Minecraft PE so I can have custom skins. I clicked on 'restore skins' without selecting any particular skin, It is now stuck with a  message saying 'we're restoring your skins!' but it has been like that for 20 minutes. Is there a reason why it is like this? Some of the git commands have many options, and it would often be useful to search through them for the one I need - I was just looking for the option which controls the TAB width in git-gui, but there are about 200 completions for git config. An obvious workaround is to copy all the completions into an editor and search through them, but I'd rather do  [something] | grep tab   There are no man or info pages for compgen, help compgen doesn't even explain its own options, and there's no auto-complete for compgen (how's that for irony?).  PS:  doesn't work.  PPS: This is not a question about git-gui - The  was elsewhere.  PPPS: This is not about auto-completing commands, only command parameters. Do you ever need to specify 'javascript:' in an onclick? Case assignment rule is always executed in the test class Term for words like Snowmageddon, Nipplegate and even cheeseburger? I have an interesting mathematical/electrical dilemma and I'm not sure where to start.  I am considering buying  (specs on page).  I will be hopefully buying a battery pack with it to support a long-road trip (a few months) wherein I'll keep medication in the fridge (powered by the battery pack when parked and by the car when driving). The medication needs to be keep between 2 and 8 degrees C at all times.  Here's the  I'm thinking of getting:  Can someone please help me understand what I need to do in order to calculate whether or not this fridge + battery combo will work, and if so, how much time will I be able to power the fridge for.  Ideally, I need a combination of fridge and battery which will allow me to have the fridge constantly powered, assuming I sleep in the car for approx. 8 hours a night and drive for the rest of the day (although, there will be times which I'm away from the car during the day for several hours + times where I hope to have access to a wall outlet).   Specs:   Fridge:   Input voltage (AC 220-240 V Input frequency 50/60 Hz Rated input power (AC) 64 W Rated input power (DC) 46W DC12V/50W DC24V W Input voltage (DC) 12/24 V   Battery:   Capacity: 453Wh Battery Type: Lithium-ion Input Voltage: AC 110-220 V, 50/60 Hz; Solar Power: 18 V; Car Input: 12 V Output Voltage: AC 110V 60 Hz; DC Output: 4 * 12V 4 A (Max.10 A); USB Output: 4 ports: 2* 5V 2.1 A and 2* 5V 1 A Power Output: Rate 500 W Peak/Surge 1000 W How do I re-position the displayed image on my laptop? I want to re-position the display on my ASUS K53SM laptop's screen because I somehow managed to damage some portion of it (and I don't want to spend on this laptop for the time being).  Please refer the following image:    I changed the resolution from 1366x768 to 1280*768 to avoid the bad portion of the screen, but the screen is now centered and the right portion of my screen is now rendered useless.  What I want to do is, set a custom resolution of my laptop and re-position it in a way that is utilizes all the working area of my screen.  How do I re-position the displayed image on my laptop?