Data is from a table in a pdf which is extracted by converting to text(using pdftotext). This is an example of the kinda data that from which im trying to capture all lines in python starting with district1 till the line with Total(included), but doesn't include any empty lines(^\n) or lines with keywords like Call or Office.   Regex I've tried  Applied a DOTALL flag too.  I tried to capture in python like this : re.findall(r'District.*icts(.*Total.*?\n|\r)',input,re.DOTALL)  District.*icts(.*Total.*?\n|\r)   The above captures(not simply match) everything in between district1 and Total(inclusive). But I want remove the captured lines or don't capture lines which contains keyword Call or Office. So i tried to apply a negative lookahead, but it didnt work either:  District.*icts(((?!Call|Office|^\n).)*Total.*?\n|\r)   Been with this problem whole day. I'm not getting any other idea on ignoring those lines and capturing the rest. Any help would be appreciated.  POSSIBLE VARIATIONS OF INPUTS  ---dont capture this line----             District    No. of positive cases admitted        Other Districts district1                           7                        1 district4 district2                           6 district3                           7                         -                Call Centre:12323, 132123                                    Office:212332122 , 1056   district4                           131         Total                       263 ---dont capture this line----   ---dont capture this line----             District    No. of positive cases admitted        Other Districts district1                           7                        1 district4 district2                           6                Call Centre:12323, 132123                                    Office:212332122 , 1056 district3                           7                         -    district4                           131         Total                       263 ---dont capture this line----   ---dont capture this line----             District    No. of positive cases admitted        Other Districts              Call Centre:12323, 132123 district1                           7                        1 district4 district2                           6                                       Office:212332122 , 1056 district3                           7                         -    district4                           131         Total                       263 ---dont capture this line----   Required Capture  district1                           7                        1 district4 district2                           6 district3                           7                         -   district4                           131         Total                       263
I know it's possible to match a word and then reverse the matches using other tools (e.g. grep -v). However, is it possible to match lines that do not contain a specific word, e.g. hede, using a regular expression?   Input:  hoho hihi haha hede   Code:  grep "&lt;Regex for 'doesn't contain hede'&gt;" input   Desired output:  hoho hihi haha
How do I view 'git diff' output with my preferred diff tool/ viewer? When I type git diff, I want to view the output with my visual diff tool of choice (SourceGear "diffmerge" on Windows). How do I configure git to do this? My LAN server won't let my cousin join me or me join my cousin. It won't show up on the multiplayer screen - it keeps saying "scanning for LAN servers" but it never finds it. I am at his house and we use different computers but it won't connect. How can I fix this? $(document) vs. $("document") The definite and zero article with the word "civilization" Illustrator Vector Graphics Appearing Pixellated This has been puzzling me for a few days now, and I asked a graphic designer I knew before trying here and haven't been able to solve it yet. It's quite weird so please bear with me for a bit.  I am using Adobe Illustrator to create a logo, and I have something that can potentially work. I have used only the pen tool with strokes (no fill), but the issue is, when I view the logo at 100%, it looks pixellated! I know vectors should not even be able to appear pixellated, but they are. Here is the screenshot from AI, without exporting to anything:     That was just done using the snipping tool within Windows, and it's at 100% zoom.  I have anti-aliasing turned on from Edit > Preferences > General, and the document resolution is at 300 ppi (I get the same result with 72 ppi).   Could anyone help me with this?   If relevant: Using CS6, and have a 24 inch Dell U2412M at 1920x1200 resolution. I do have a 21.6" Samsung at 1680x1050 and I get the same result there as well. Let me know if you need any other settings, or if you would like the file, I'd be happy to provide it to be able to solve this problem. Why do my lamps require an insane "strength" value of 1 million? To turn off my system, I can use one of these three commands:  sudo halt   Or:  sudo poweroff   Or:  sudo shutdown -h now   What are the differences between these commands, or are they all just aliases of each other? Sometimes I need to look up certain words through all the manual pages. I am aware of apropos, but if I understand its manual right, it restricts search to the descriptions only.     Each manual page has a short description available within it. apropos searches the descriptions for instances of keyword.   For example, if I look up a word like 'viminfo', I get no results at all...  $ apropos viminfo viminfo: nothing appropriate.   ... although this word exists in a later section of the manual of Vim (which is installed on my system).      -i {viminfo}                When  using  the  viminfo file is enabled, this option sets the filename to use, instead of the default "~/.vim‐                info".  This can also be used to skip the use of the .viminfo file, by giving the name "NONE".    So how can I look up a word through every section of every manual? Removing unwanted appearance of underlying mesh For any triangle with sides $a$, $b$, $c$, show that $a^2b(a-b)+b^2c(b-c)+c^2a(c-a)\ge 0$ Solve this integral for free WiFi I saw this today, I checked in Mathematica and the integral comes out to $\pi$, but I have no idea how to solve it.     FREE Wi-Fi: The Wi-Fi password is the first $10$ digits of the answer.   $$\int_{-2}^2\left(x^3\cos\frac x2+\frac12\right)\sqrt{4-x^2}\ dx$$ No room for a new \dimen I have this error message:  ! No room for a new \dimen . \ch@ck ...\else \errmessage {No room for a new #3}                                                 \fi   which I can not find a cure for. Showing arrowheads in line end using QGIS? I would like to show arrowheads in the endings of every drawn linestring.  Is it possible in QGIS?    I have been trying to use a marker line but repeats all de arroheads all over the line, it is not restricted to the ends: If $X_1, ..., X_n$ are independent identically-distributed random variables, what can be said about the distribution of $\min(X_1, ..., X_n)$ in general? Sketch complex curve $z(t) = e^{-1t+it}$, $0 \le t \le b$ for some $b>0$ Surface tension: the paper clip experiment In the paper clip experiment, the surface tension of water prevents the clip from falling, thus we can assume it exerts a force of $mg$ (weight of clip) upwards.   However, if you try to pull the clip out of water, surface tension opposes this motion also. If for simplicity we assume that the clip is a rectangle of length $l$ and breadth $b$, and the surface tension is $T$, then the liquid exerts a downward force of: $$T×2(l+b)$$  What is going on here? Why is there an inconsistency in the direction along which the force acts? unable to reset root password of mysql What is the best prepaid SIM card for data in France? I'm going to travel to Paris in two weeks for 5 days. I'd like to buy a prepaid SIM card for my phone, no calls or SMS needed - only data is sufficient. I've looked through French mobile operators and found nothing really acceptable. For example, in Finland I bought SIM card for €5 with 3GB of data.   So, the question is - what is the best SIM card for me, assuming that 1GB is enough (considering the prices) and that I am actually will be able to use it (I've read that some operators turn on mobile data only after 5 days which is unacceptable for me considering that I'll be there for 5 days only)? Which creatures in Tolkien's literature can be female? Can photons be detected without being absorbed? I am thinking about a detector that would beep if light passes through it. Is it possible?