How do i match a domain from each of the strings below using python regex. In this case s1 is invalid becaulse .local is not a good valid tld  s1 = '220 Exng-CAS1.aldanube.local Microsoft , 16 Feb 2016 14:52:24 +0400' # ignore this  # catch all this  s2 = '220 mail6.mithi.com'  s3 = '220 news-letter.music.jp unknown' s3 = '220 nice .music.co.uk Welcome to the server. 16 Feb 2016 14:52:24 +0400'  &gt;&gt;&gt; import re &gt;&gt;&gt; r = re.match('[a-zA-Z0-9\-]+\.', s1) &gt;&gt;&gt; r.group() Traceback (most recent call last):   File "&lt;stdin&gt;", line 1, in &lt;module&gt; AttributeError: 'NoneType' object has no attribute 'group'
What is the difference between the search() and match() functions in the ?  I've read the  (), but I never seem to remember it.  I keep having to look it up and re-learn it.  I'm hoping that someone will answer it clearly with examples so that (perhaps) it will stick in my head.  Or at least I'll have a better place to return with my question and it will take less time to re-learn it.
Info Icon vs Question Mark NetworkOnMainThreadException on higher API I have reviewed this:   but it does not answer my question. The suggested fixes in this question is to set up FB, IG, and other social media pages. We have had these for months. We have 576 Instagram followers, 293 followers on Facebook, 17,425 views on Vimeo, Youtube, Pinterest and LinkedIn presence. Here is the response in a YouTube search:  Let's be clear. If you search for my company name and product name YT changes the spelling to something that doesn't exist and suggests a video with no matching result terms (using either spelling) disparaging OTHER luxury handbags, while insinuating it is referring to my handbags. When a user searches for our business, , Google and Youtube changes the spelling to Aslan Vaughn and displays these results:  For the first few months it just seemed like it was taking some time to percolate, but over 7 months we have had 17,500 unique visitors and nearly 90 backlinks.  The only results for Aslan Vaugn is the birth announcement of the second child of a musician in New Jersey. It is a Facebook post and has 14 likes. Google is favoring a spelling that has only two results with 14+ views over dozens of links and tens of thousands of views. How is this possible? An FB post with 14 likes is that much more popular than a business with 17,500 unique visitors (despite the Google obfuscation)? Is my company on some list? On other search engines my company covers the first few pages in results. Through Google, you cannot find our company no matter how many pages in you go. Unless you search for the term in quotes, . In which case we cover the first few pages here as well: What do wizard children do before attending Hogwarts? Most of the wand-carriers that come from a non-Muggle family seem fairly uneducated when it comes to interacting with Muggles.  This implies that they don't go to any type of Muggle school before entering into their education at Hogwarts (or whichever Wizarding school they go to), or else they would at least understand some Muggle culture.  What do children from magical families do before going to Hogwarts if they don't go to a traditional school?  Is there any evidence that they're homeschooled? OAuth redirect URL is not honored Addressing a former office-holder by that office's title When is it appropriate to use an "expired" honorific to address or refer to a person?   In the U.S., former state governors are occasionally referred to as "Governor So-and-so", although they have not held that office for several years. I see this happening most often when the former governor is actively campaigning for a new office (usually U.S. President), and my impression is that it's done only by someone with an interest in the campaign (for or against) rather than a (relatively) neutral party like a newspaper.  Certainly this could be used as a jab: in a political campaign for high office, addressing one's opponent by a former title — lower than one's own — could imply that the opponent is not qualified for the new job. It could also be used the other way around, to remind listeners that a candidate one supports used to hold an important title.  I'm curious whether there are formal rules for this in the U.S., or at least style or journalist guidelines, for various offices. Are ambassadors, for example, entitled to some sort of emeritus honorific? How can I configure the Ubuntu Dock to show windows only from the current workspace? A quick search for ESTA application returned many results. According to , the official site to apply for an ESTA is .  Are the others scams, legitimate third party resellers or "added value" services?    (defunct - domain is for sale circa 2020)     Can anyone confirm either way?  Updated 2020: The above have better "not affiliated with the U.S. Government" warnings now, but beware there are newer more sneaky sites starting all the time:        And fortunately more official guidance about this issue: Show that the set of functions $\mathbb{N}\to\{0,1\}$ is not countable Recall that a countable set $S$ implies that there exists a bijection $\mathbb{N}\to S$. Now, I consider (0,1). I want to prove by contradiction that $(0,1)$ is not countable.  First, I assume the contrary that there exists a bijection $f$, and I can find an element in $S$, but not in the range of $f$. But I can't find such element. How can you construct such $f$? Sql Server 'Saving changes is not permitted' error ► Prevent saving changes that require table re-creation Im creating a community user from an Apex code. When our internal users (non-admins) run the code they are getting following error. (This was working fine when we test the feature in sandbox)     SObjectException: Field is not writeable: User.ProfileId   The code is       //Grab Community User Profile     Profile p = [Select Id, Name from Profile where Name = :COMMUNITY_PROFILE LIMIT 1];       User PortalUser = new User();          PortalUser.UserName = Con.Email+'-POC';         PortalUser.ContactId = Con.Id;         PortalUser.ProfileId = p.id;         PortalUser.Email = Con.Email;         PortalUser.EmailEncodingKey = 'UTF-8';         PortalUser.FirstName = Con.FirstName;         PortalUser.LastName = Con.LastName;         PortalUser.TimeZoneSidKey = 'America/Los_Angeles';         PortalUser.LocaleSidKey = 'en_US';         PortalUser.LanguageLocaleKey = 'en_US';          if (Con.LastName.length() &gt;= 8){             PortalUser.Alias = Con.LastName.substring(0, 7);             }else{             PortalUser.Alias = Con.LastName;         }             SObjToInsert.add(PortalUser); Limit position rigidbody How can I limit the position of a rigidbody, between two values ​​if I use this code:  public Vector3 dir;  Rigidbody rb;  void Awake() {     rb = GetComponent&lt;Rigidbody&gt;(); }  void FixedUpdate() {     rb.velocity = new Vector3(0f, 0f, 6f);      rb.AddForce(dir * 1f, ForceMode.VelocityChange); }   If I use Vector3.Clamp then the object will shake What are the recommended textbooks for introductory calculus? I've already taken my calculus sequence and I'm interested in brushing up and staying sharp on the basics. So far, my calculus background is limited to single-variable calculus, which I applied in my physics sequence and engineering statistics. I learned a little bit of vector math in physics as well, but I'm not strong in it. My mathematical strengths lie in the discrete mathematics.  I'm particularly interested in studying for my IEEE Certified Software Development Associate exam - 10% of the exam is mathematics (calculus, differential equations, and statistics). Calculus is one of the mathematics knowledge areas that a software engineer should be competent in, so I'm looking for not only solidifying the courses that I've already taken, but moving forward with slightly more advanced topics, at an undergraduate mathematics level.  I'm currently using the textbook from my calculus sequence, but I'm interested to know what books other people used to learn calculus and if the book is potentially worth checking out.  What books are available to help me? Nsolve gives solutions with a small complex part which can't be eliminated by chop command How do you make Ubuntu accept files sent over bluetooth I have a problem when I send my files from phone to ubuntu 12.04 via bluetooth as the phone prompts with the message "the file not sent"! I can send any files from ubuntu 12.04 to my android phone. As a student, I make mistakes all the time, and stealing my idea will not face heavy retaliation. I don't mind if someone comes up with concurrent works, but I do mind if my key idea is leaked. Many graduate students in my field therefore only use pre-print services if their papers are either publicly presented or conditionally accepted. I am looking for a website that can do most of what ArXiv does, with an additional private option or limited visibility, for example an option to make the paper unindexed by search engines. This way, my paper cannot be seen for at least a few months. By doing so, I can at least claim that I am one of the first few researchers who got the idea right. And most importantly, I can privately correct my mistakes, if any. Publishing mistakes is embarrassing and sometimes harms one's career. Many mistakes will be revealed during the peer-review processes and I have a chance to correct them before publicizing. Please kindly think twice before giving ethically and &quot;politically correct&quot; comments like no one will scoop me, everyone will cite me, and the scoopers will be punished. At least in my field, scooping and idea-stealing is commonly observable, and big-names don't care about publicizing pre-prints because they have resources to punish the scoopers. I do understand that keeping my work private might harm the community as the information becomes less transparent. However, it could also be possible that my un-reviewed flawed works misguide the community, and a paper reviewed will benefit the society more. I personally wasted six months because of someone else's mistake in a published work.  I heard that in molecular biology there is a widely-used service to upload your research data, like protein structure and sequencing, to get a timestamp. The uploaded materials can be set to be private for a period, and fully disclosed later. A lot of people do use this function. This is not exactly what I am looking for but shares some similar ideas. If I remember correctly, there is an interesting paper studying the scooping patterns with the aid of this database.  Solutions found!  and some other university-run pre-print services do have an embargo function. Moreover,  is a widely used repository, that, unlike arxiv, only displays the newest version to the general public, although still keeps a tag on the first submitted date! Google map only loading half of itself LaTeX template for typesetting a novel Slow leak on front cruiser tire I ride my cruiser to the supermarket and back, using either a trailer or a basket over the front wheel for carrying groceries. The bike has developed a persistent slow leak on the front wheel, and I've replaced the tube without it helping. I can't see anything puncturing the tire, and the spokes aren't poking through the rim tape that I can see.   These are 26" wheels with low pressure (around 40 - 50 psi). What else can I look for that might be causing this? I have a problem with the use of "the" after "and" where you would basically be connecting words. For example, which of the following is better:     The table and the chairs?   The table and chairs?   Or are both okay? What is the rule, and are there exceptions to it? Or is the rule just contextual and may vary between the sentences and meanings?