I am using lib pexpect to wait for the prompt line:  '[root@%s]#' % (x)   where x is a machine name "ABC-EFG-0001", which contains hyphen "-" and therefore the bad character error in regex. How do I make it to take the hyphen as it is (to take the machine name)? I've checked if the hyphen is removed then error is gone.  P.S These script used to work (in 2015), without any change now gives bad character range error, was there anychange in re.py?  the error msg:  File "/projects/hnd_tools/python/pexpect-0.99/pexpect.py", line 623, in expect     compiled_pattern_list = self.compile_pattern_list(pattern) File "/projects/hnd_tools/python/pexpect-0.99/pexpect.py", line 557, in compile_pattern_list     compiled_pattern_list.append(re.compile(p, re.DOTALL)) File "/usr/lib/python2.7/re.py", line 190, in compile     return _compile(pattern, flags) File "/usr/lib/python2.7/re.py", line 245, in _compile     raise error, v # invalid expression error: bad character range   thanks.
I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?
This is a follow-up to .     When I click a link to an SE site in the Android app, it gives me an "open with" pop-up that has two options:         Chrome   Stack Exchange         I can then choose to open SE posts like this "Just once" or "Always."      The problem is that when I set the SE app to "always," and I click "open in browser,"   Except, the app crashes when trying to open it in browser.  LogCat (just right after selecting "Open in browser")  01-22 18:03:36.354: E/AndroidRuntime(16064): FATAL EXCEPTION: main 01-22 18:03:36.354: E/AndroidRuntime(16064): Process: com.stackexchange.marvin, PID: 16064 01-22 18:03:36.354: E/AndroidRuntime(16064): java.lang.NullPointerException: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference 01-22 18:03:36.354: E/AndroidRuntime(16064):    at com.stackexchange.marvin.utils.Helpers.getNonMarvinViewIntent(Helpers.java:452) 01-22 18:03:36.354: E/AndroidRuntime(16064):    at com.stackexchange.marvin.ui.question.QuestionDialog$1.onClick(QuestionDialog.java:39) 01-22 18:03:36.354: E/AndroidRuntime(16064):    at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:1108) 01-22 18:03:36.354: E/AndroidRuntime(16064):    at android.widget.AdapterView.performItemClick(AdapterView.java:310) 01-22 18:03:36.354: E/AndroidRuntime(16064):    at android.widget.AbsListView.performItemClick(AbsListView.java:1145) 01-22 18:03:36.354: E/AndroidRuntime(16064):    at android.widget.AbsListView$PerformClick.run(AbsListView.java:3066) 01-22 18:03:36.354: E/AndroidRuntime(16064):    at android.widget.AbsListView$3.run(AbsListView.java:3903) 01-22 18:03:36.354: E/AndroidRuntime(16064):    at android.os.Handler.handleCallback(Handler.java:739) 01-22 18:03:36.354: E/AndroidRuntime(16064):    at android.os.Handler.dispatchMessage(Handler.java:95) 01-22 18:03:36.354: E/AndroidRuntime(16064):    at android.os.Looper.loop(Looper.java:148) 01-22 18:03:36.354: E/AndroidRuntime(16064):    at android.app.ActivityThread.main(ActivityThread.java:5417) 01-22 18:03:36.354: E/AndroidRuntime(16064):    at java.lang.reflect.Method.invoke(Native Method) 01-22 18:03:36.354: E/AndroidRuntime(16064):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 01-22 18:03:36.354: E/AndroidRuntime(16064):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)   I suspect it's related to , but not sure.  Specs:   Device model: Nexus 5 Android version: Android 6.0.1 SE app version: 1.0.82 (beta) Installed browser: Chrome 47.0.2526.83 (latest at current writing) I have a doubt. I need help.  Can the basic axioms of equality be presented as "open axioms"?  I) (reflexivity) $\qquad x = x$              II)  (Substitutivity) $\qquad (x = y) \to \big(F (x, x) \to F (x, y)\big)$ Prove that $|\log(1 + x^2) - \log(1 + y^2)| \le |x-y|$ I need to show that $ \forall x,y \in \mathbb R, |\log(1 + x^2) - \log(1 + y^2)| \le |x-y|$  I tried using concavity of log function: $\log(1 + x^2) - \log(1 + y^2)=\log(\frac{1 + x^2}{1 + y^2})=\log(\frac{x^2y^2}{(1 + y^2)y^2}+\frac{1}{1 + y^2}) \ge \frac{2(\log(x)-\log(y))}{1+y^2}$  Also the middle value theorem: $0&lt;\frac{\log(1 + x^2) - \log(1 + y^2)}{x^2-y^2} &lt;1$  But both attempts has not led too far. Is it possible to see a list of the settlers in a given settlement and the jobs they are assigned to? It would make it easier to pick a settler for a new job. Partial or entire Image Blurring in TikZ?  I have seen some examples of drop shadow blurring in the pgf-blur package version 1.01 by Martin Giese but this isn’t what I mean.  Is it somehow possible to do partial or entire Image Blurring in TikZ, just like what one may do in Adobe Photoshop? I have a sentence:     Please show me the right way so that I can do that rather than take blind action.     Is this sentence grammatically correct?   Can I use instead of to replace rather than? If replaced, the meaning of this sentence is changed?   What is the difference between rather than and instead of? Can you show me some examples to distinguish them? How to render text pixel-perfectly with subpixel antialising with Illustrator? Python "if X == Y and Z" syntax I need to write a small program that can detect that it has been changed. Please give me a suggestion!  Thank you. We know the optimum angle for greatest horizontal displacement when launching an object with projectile motion is 45 degrees.  How to solve the angle when it is real long distance around the earth where we cannot assume that gravity is constant but is given by $F=\frac {-GMm}{r^2}$. I use differetial equation to solve it and obtain 45 degrees.   First, for the vertical distance $y$, change $v=u-gt$ to $y'=u-y''t$. Then solve it to obtain a function $y(t)$. When $y'(t)=0$ we have the time for maximum vertical distance. Then insert the value to horizontal equation.   Can anyone guide me through this problem because I am not confident with my working Why $\sqrt[3]{{2 + \sqrt 5 }} + \sqrt[3]{{2 - \sqrt 5 }}$ is a rational number? How to create a cable/wire for animation? So I've created a "noodle" with a path and a bezier Circle that has soft body so that when I click play it will drop and flop about.    What I'm trying to do is have one of the cubes stationary while the other moves around having the noodle between them stretch and move around like its a cable.   Any tips on this? Proof by Induction: For any integer $n > 0$, $3|(5^{2n} − 1)$. Identifying Coordinate System of Shapefile when Unknown? Currently my bibliography says "Literatur" (german). But I want something completely different there. How can I achieve that? Journal vs conference publications when looking for a job in in computer science I'm currently a post doc in theoretical computer science and I have a double digit number of conference publications, about half of which are at so called "tier 1" conferences (SODA,STOC,...). Unfortunately I only have 1 journal publication so far, mainly due to coauthors dragging their feet.   Will the lack of journal publications have a great impact when applying for a faculty job in cs-theory at some point, and is it advisable to try to up this number before applying? Or is this fully compensated by having sufficiently many conference papers? I'm trying to compose a cone in Inkscape, embedding text, image (after converted in vectors):   But, after importing in Blender, here is what I get:   You see then that something went wrong, but I don't know what. Please your advise is welcome !  JF Is the Star Wars Universe just one galaxy? What potions actually grant fame or glory, or put a stopper in death? Are there any? ‘You are here to learn the subtle science and exact art of potionmaking,’ [Snape] began. He spoke in barely more than a whisper, but they caught every word – like Professor McGonagall, Snape had the gift of keeping a class silent without effort. ‘As there is little foolish wand-waving here, many of you will hardly believe this is magic. I don’t expect you will really understand the beauty of the softly simmering cauldron with its shimmering fumes, the delicate power of liquids that creep through human veins, bewitching the mind, ensnaring the senses ... I can teach you how to bottle fame, brew glory, even stopper death – if you aren’t as big a bunch of dunderheads as I usually have to teach.’&#185;   Philosopher's Stone - page 102 - Bloomsbury - chapter 8, The Potions Master   Are there any canon potions that actually grant fame or glory, or stopper death? I'm looking for specific canon-based answers from sources such as the Harry Potter books, interviews with J.K. Rowling, or information from Pottermore. Maybe because it's early I'm overlooking the obvious, but offhand I can't think of any canon potions that fit this criteria exactly.   &#185;I edited in the entire paragraph that I can teach you how to bottle fame, brew glory, even stopper death comes from for clarity. Hopefully this will be helpful and provide a better context for the comment in question. How to resize partitions?