Posted by: xSicKxBot - 02-01-2020, 04:37 AM - Forum: Lounge
- No Replies
What Am I Supposed To Do With This PlayStation Vue Roku Button Now?
Sony's live TV service, PlayStation Vue, is dead. As announced last year, Sony shuttered the service as of January 30, 2020. If you're a subscriber, that means you'll need to find another streaming service if you're committed to cutting the cord. If you're me, you're stuck wondering what the hell I'm supposed to do with this useless button on my Roku remote.
The remote in question
Look at it. It's just sitting there, staring at me, threatening to interrupt what I'm watching should I or my cat accidentally press it. With Vue now dead, there is literally no reason to ever make use of this button, because should I do so, I will only be faced with a reminder of its death and the nagging worry that one day, maybe Steam will no longer exist, or those movies I own through some service will no longer be accessible if my account isn't properly linked.
It's not as if I was using the Vue button prior to this. I've never been a Vue subscriber, instead choosing to use Hulu TV and YouTube TV to get my fix of live basketball and ad-laced, modified-for-your-television reruns of Avengers: Age of Ultron on TNT. But that button at least had potential: Perhaps one day I would click it by mistake and be wooed by the offer of a free trial and find that it offered a superior experience to Hulu or YouTube.
Now, that potential is gone like the carefree days of my childhood, and I'm left with a relic for which I have literally no use--at least the countless old power cords sitting in a bucket might one day gloriously find the devices with which they're meant to be partnered.
I could pry the button off and give it to my cats, one of which would be delighted with it, but he could just as easily be entertained by a twist tie, so it doesn't seem worth the effort. (The button obviously isn't intended to be removed, and I learned my lesson with this sort of thing when I took the safety label off my car's driver-side sun visor.) I could find some way to reprogram the button, but a cursory search suggests that's no easy task; Roku has presumably struck deals to include these branded buttons that don't allow for that. But as the streaming wars heat up and some services don't make the cut long-term, Roku might want to be a little more selective with who ends up on its remotes.
Earlier this week, when we deployed 2.7.1, we discovered an issue causing players to lose various currencies. Our team immediately took action and brought the game down for maintenance while we worked to discover the source of the issue. We did this to minimize any further impact to players. We ended up doing the first-ever character rollback in Destiny’s history to ensure that no one lost any of their hard-earned materials. We’re sorry for any inconvenience caused by the unexpected maintenance and appreciated everyone’s patience while we worked to get the game back online.
We’ll continue to improve our efforts to minimize issues and downtime. Even though some bugs are always going to crawl through the cracks, we’ll be waiting on the other side with a swatter.
Empyrean Foundation
Next week, the Empyrean Foundation rebuild effort begins. Saint-14 will ask all Guardians to contribute to building a beacon that will be a foundation for things to come next Season. The Tower Obelisk will be the focal point of this event, so make sure you have it unlocked and ready to go as it’s going to have some hefty benefits to take advantage of.
Players will need to come together and contribute resources towards a common goal. To participate, players can donate their Fractaline using the Tower Obelisk. The event will have seven stages, each requiring increasing amounts of Fractaline to progress through. There will also be a hologram at the Tower Obelisk where you’ll be able to track the community’s progress in game.
Of course we aren’t going to ask you to fork over your hard-earned Fractaline without providing some benefits. Here’s what’s in it for you:
Contributing to the Empyrean Foundation costs 100 Polarized Fractaline.
Contributing generates a 25% flat progression for all Timelost weapon bounties in your inventory.
Your Tower Obelisk will generate Polarized Fractaline for you each week equivalent to its Resonance Power.
Increase its Resonance Power by upgrading other Obelisks
Players who donate more than 5,000 Polarized Fractaline before the end of the Season will earn a Triumph and emblem.
Everyone in the community will also receive a shader when all stages are completed. Here’s a look at community goals for the seven stages.
Stage 1: 400,000,000
Stage 2: 700,000,000
Stage 3: 1,200,000,000
Stage 4: ???
Stage 5: ???
Stage 6: ???
Stage 7: ???
Everyone is welcome to contribute. This event will be available to all Destiny 2 players and doesn’t require the Season Pass. You can start prepping this week by stockpiling Fractaline and making sure that your Tower Obelisk is powered up and ready to go.
Prime Time
Yesterday, we announced that we are teaming up with Twitch Prime to deliver in-game rewards to Destiny 2 players with an active Prime membership. We are planning to have six monthly drops, with each drop containing four rewards.
The first gear drop is live now and will be available until February 25. It includes the SUROS Regime Auto Rifle, the Coup de Main Ornament, the Skyline Flipside Exotic Ghost Shell, and the unsecured/OUTCRY Exotic ship.
Guardian Giveaways
This week, the Bungie Store is celebrating Guardians everywhere with a giveaway contest featuring curated collections of Destiny gear, including sold-out Shadowkeep Collector’s Editions signed by the Bungie team. For a limited time, a variety of discounted merchandise bundles are available on bungiestore.com and eu.bungiestore.com.
To enter, follow @BungieStore on Twitter, retweet the current giveaway post and add #GuardianGiveaways. The contest ends February 4, 2020 8:59 AM PST. Entries from EU, UK, USA, & CN only (see Rules for excluded provinces and states). 18+ to enter. Please see the Official Rules for more information.
Guardians for Australia
Our “Guardians for Australia” T-shirt is still available for pre-order on the Bungie Store and Bungie Store EU. Half of all profits generated by these T-shirt sales will be donated to NSW Rural Fire Service. The second half will be donated to WIRES, Australia’s largest wildlife rescue organization.
Purchase of the shirt also includes an exclusive Destiny 2 “Star Light, Star Bright” emblem. Thanks for helping us support Australia’s firefighting and animal rescue efforts.
Rollback to the Future
Player Support has a key role of working with the entire team to make sure you are aware of deployments and efforts to restore service during outages.
This is their report.
UPDATE 2.7.1 AND ROLLING BACK ACCOUNTS
After Update 2.7.1 went live on Tuesday, January 28, the Player Support team began noticing a trend of topics where users had lost various Destiny 2 currencies and infusion materials. After verifying this issue, it was decided by several Bungie teams to take the game down in an attempt to prevent more players from being affected.
Due to the rollback:
Any progress or quest that completed between 8:30 and 10:30 AM PST would have to be redone.
Any item gained during that timeframe would have to be earned again.
Purchases made during that timeframe would have to be redone, and Silver spent would be restored.
Platform store-purchased Silver bundles would not be affected since they are completed on the platform’s end.
After the rollback completed, Destiny 2 server came back online around 7:00 PM PST. We are continuing to investigate why this issue occurred and may provide more information about it in the future.
TWITCH PRIME SUPPORT
To receive the gear drops mentioned in the Prime Time section above, players will need an active Amazon Prime account, Bungie.net account, and a Destiny 2 account. Once these accounts are linked, players can claim their drops on the Destiny 2 Twitch Prime website, then log into Destiny 2 and speak to Amanda Holliday in the Tower Hangar to claim the drops.
CURRENT KNOWN ISSUES
While we continue investigating various known issues, here is a list of the latest issues that were reported to us in our #Help Forum:
The Pigeon and the Phoenix lore book triumphs can no longer be viewed by players who unlocked them. This will be resolved in a future update.
Tower load times have increased after Update 2.7.1.
The Green With Envy quest is not properly recording Infamy rank for some players after Update 2.7.1.
For a full list of emergent issues in Destiny 2, players can review our Known Issues article. Players who observe other issues should report them to our #Help forum.
Year of the Rat Kings
You ever see a video so funny that you sprayed milk out of your nose? I haven’t, but I have a strict no-drinking-milk-while-watching-videos policy. Take a look at our winning movie this week (and careful with the milk!)
Movie of the Week: Rat Attack
Honorable Mention: Awakening
Movie of the Week winners will find a new emblem in their collections. Just make sure to put a link to your Bungie.net profile pages if you win so we know where to send them. We’ll pick our favorite video from anywhere on the safe-for-work internet where Destiny videos are posted. But if you really want that emblem, the best place to submit your video is the Community Creations page.
When you read this, I’ll be traveling to visit family in Texas and Oklahoma next week. But don’t worry, the Community team has been growing fat with strength and will have everything covered while I’m out. I won’t be fully out of action though. I’ll be contributing to the Empyrean Foundation community event from the road using Stadia.
We look forward to watching the community mobilize in force to answer our challenge. We always try to set the bar high, since you have crushed our expectations in the past. Let’s see what you got this time.
Nintendo Has “No Plans” To Release A New Switch Model This Year
Despite ongoing rumours about a pro model Switch arriving at some point this year, Nintendo hasn’t said a thing about it. If it does exist, though, don’t expect it to be released anytime soon.
During the company’s latest financial results briefing today, Nintendo president Shuntaro Furukawa said there were “no plans” to launch a new Switch model in 2020.
Regarding Nintendo Switch, we believe that it is important to continue to communicate the appeal of both Nintendo Switch systems and expand the installed base. Please note that we have no plans to launch a new Nintendo Switch model during 2020.
As explained by Furukawa, Nintendo will instead focus on the appeal of its existing line of Switch systems – this includes the original model and the Lite model, which was launched in September last year.
Earlier today, Nintendo announced a new Animal Crossing: New Horizons themed Switch, which will no doubt increase sales of the original model. It arrives in North America on 13th March, and in Europe and Japan on 20th March.
Were you hoping to see a new pro model Switch released this year? Comment down below.
Xbox Insider Release Notes – Alpha Ring (2002.200120-2000)
Hey Alpha ring users! Today’s Xbox Insider Release Notes highlight the latest fixes, known issues, and features coming to your console. Starting at 2:00 p.m. PT today, users will receive the latest 2002 Xbox One system update (build: 19H1_RELEASE_XBOX_DEV_2002\18363.9115.200120-2000). Keep reading for more details.
System Update Details:
OS version released: 19H1_RELEASE_XBOX_DEV_2002\18363.9115.200120-2000
Available: 2:00 p.m. PT – January 22, 2020
Mandatory: 3:00 a.m. PT – January 23, 2019
Fixes for Alpha
We’ve heard your feedback, and we’re happy to announce the following fixes have been implemented for this 2002 build:
Home
Fixed an issue where the incorrect Gamerpic would be displayed on the dashboard after being edited.
My Games & Apps
Fixed an issue where My Games & Apps would crash while browsing collection.
Users should no longer lost focus when navigating their collection.
Filters for backwards compatible titles have been restored when browsing.
Users should now be able to navigate to Manage Contents correctly via collection.
Fixed an issue where DLC content would not install from the Manage Game menu.
System
Various updates to properly reflect local languages across the console.
Known Issues for Alpha
We understand some issues have been listed in previous Xbox Insider Release Notes. These issues aren’t being ignored, but it will take Xbox engineers more time to find a solution. We appreciate your patience at this time!
Audio
We’re aware of an issue where users who enable Dolby Atmos formats (Home theater or headphones) on their console may experience Netflix playback errors with Atmos enabled shows and movies.
Workaround: Disable Dolby Atmos in Settings while we fully diagnose and rectify the issue.
Users who have Dolby Atmos enabled and console display settings set to 120hz with 36 bits per pixel (12-bit) are experiencing loss of Dolby Atmos audio in some situations.
Workaround: Disable 120hz or set Video Fidelity to 30 bits per pixel (10-bit) or lower.
Messaging
Users are unable to send a voice message while in Parties.
Workaround: Send the message while not currently in party chat.
My Games & Apps
Users tile size and filtering choices in collection will revert to defaults in some sections.
When using “Group by letter” filter, using the “Jump to Letter” menu will have UI issues.
Attempting to Hide/Unhide games/apps in collection via button combination not working.
Some users have reported not seeing all available content in their collection
Note: Please make sure to include any specific missing titles in your feedback description.
Users have reported that installed games are appearing in Ready to Install menus.
Some users may experience problems moving pinned icons within Groups.
Some titles in collection may appear with a “trial” tag incorrectly in collection.
The Search icon is not currently working when browsing collection.
Users have reported that artwork isn’t loading in the download queue while installing.
Profile Color
Sometimes users may encounter the incorrect Profile color when powering on the console.
Are you not seeing your issue listed above? Make sure to use Report a problem to keep us informed of your issue. We may not be able to respond to everyone, but the data we’ll gather is crucial to finding a resolution.
Learn more about feedback and how each ring is differentiated in the following links:
For more information regarding the Xbox Insider Program follow us on Twitter and join the community subreddit for support and updates. Keep an eye on future Xbox Insider Release Notes for more information regarding your Xbox One Update Preview ring!
Amazon Game Studios is looking for a Senior Gameplay Engineer to join an exciting new project at our Seattle studio. We are an innovative, player-focused team, working on big-bets in an innovative environment. As a senior member of the team, you will work alongside production, design, art, and engineering to create fun and memorable game experiences.
What you’ll do:
Work as part of our gameplay team in a highly collaborative environment
Design, prototype and fully implement new gameplay systems and game features
Create and maintain reliable, scalable, and high-performance systems and tools to enable gameplay experiences
BASIC QUALIFICATIONS
Bachelor’s degree in computer science or related technical discipline or equivalent experience
5+ years of professional software development experience
2+ shipped titles
3+ years experience in any of the following: physics, inputs, AI, sound, engine, game systems, tooling, or optimizations.
5+ years experience in either C, C++, or C#.
PREFERRED QUALIFICATIONS
Strong 2D/3D math.
Intuitive understanding of action gameplay and design.
Capable of quick prototyping and rapid iteration to ‘find the fun’.
Passionate gamer.
Experience with Unity or Unreal Engine.
Experience with scripting languages such as Python or Lua and visual scripting tools.
Capable of debugging optimized code.
Meets/exceeds Amazon’s leadership principles requirements for this role.
Meets/exceeds Amazon’s functional/technical depth and complexity for this role.
Whether you’re just starting out, looking for something new, or just seeing what’s out there, the Gamasutra Job Board is the place where game developers move ahead in their careers.
Gamasutra’s Job Board is the most diverse, most active, and most established board of its kind in the video game industry, serving companies of all sizes, from indie to triple-A.
Video: How Bungie crafted the music of Destiny 2’s open world
In this 2018 GDC session, composer C. Paul Johnson and Bungie’s Skye Lewin and Michael Sechrist explain how the audio team confronted the challenges of scope and scale while designing the score and musical approach for Destiny 2.
It was an insightful session in which the pair discussed how their team tackled those challenges while maintaining their quality bar, minimizing repetition, and maintaining dramatic linearity in their score.
Their talk was well worth watching, even if you aren’t a big Destiny 2 fan, so don’t miss your opportunity to do so for free now that it’s been made freely available to watch over on the official GDC YouTube channel!
In addition to this presentation, the GDC Vault and its accompanying YouTube channel offers numerous other free videos, audio recordings, and slides from many of the recent Game Developers Conference events, and the service offers even more members-only content for GDC Vault subscribers.
Those who purchased All Access passes to recent events like GDC or VRDC already have full access to GDC Vault, and interested parties can apply for the individual subscription via a GDC Vault subscription page. Group subscriptions are also available: game-related schools and development studios who sign up for GDC Vault Studio Subscriptions can receive access for their entire office or company by contacting staff via the GDC Vault group subscription page.
New Mythical Pokemon For Sword & Shield Will Be Revealed Next Month
February 27 marks the anniversary of Pokemon Red and Green's release in Japan, and The Pokemon Company is once again commemorating the occasion with a big reveal. Last year, the series' latest installments, Sword and Shield, were officially unveiled on Pokemon Day, and this year, we'll get our first look at a brand-new Pokemon for the games.
Serebii reports that The Pokemon Company will unveil a brand-new Mythical Pokemon on February 27. This special monster will appear in Sword and Shield as well as the upcoming Pokemon film, titled Pokemon the Movie: Coco. Additionally, the company will kick off a new Max Raid event in Sword and Shield that day, as well as a special event in Pokemon Go.
Serebii Update: On Pokémon Day (February 27th), a brand new Mythical Pokémon is to be revealed. This Pokémon will feature in Sword & Shield and the movie Pokémon the Movie: Coco. Special Max Raid Battles, GO events & Masters info will also run. Details @ https://t.co/gDbXkIa6crpic.twitter.com/wq3Od4XuC3
No further information about the new Pokemon has been revealed so far, but Serebii notes that the monster is separate from Urshifu and Calyrex, the two new Legendaries being introduced in Sword and Shield's Isle of Armor and Crown Tundra expansions. Those are slated to launch this June and fall, respectively.
In the meantime, a new Max Raid event is now underway in Sword and Shield. While Gigantamax Alcremie spawn rates have returned to normal, you are now more likely to encounter its pre-evolved form, Milcery, in Max Raids until February 16. Many of these Milcery will be able to Gigantamax when they evolve. Additionally, you can receive Ribbon and Star Sweets as rewards for completing Milcery Raids, allowing you to evolve the Pokemon into new variants.
A new freebie for the games is also available now. You can claim 10 free Heal Balls via Mystery Gift until March 31. To receive the balls, select Mystery Gift from your game's menu and enter the code G1GAGRANF1NALE. You can see all the other Pokemon Sword and Shield freebies up for grabs right now in our roundup.
For the last 24 years, Java technology has expanded the innovative landscape of applications and solutions we interact with either personally or professionally. And the next 24 years is shaping to be even more innovative, bringing greater opportunities to the technology landscape. And that's due to the diversity of creative minds who use Java to advance the world we interact with every day.
Since 2002, Oracle's Java Platform Group has given recognition through the Duke's Choice Award to innovators who have used Java technologies in a uniquely innovative manner, whether for a project, personal contributions, in a product, as part of a program or in a service. These innovations have represented work-in-process, ongoing research, available solutions, or implementation of Java that aides in the delivery or execution of productive functionality in a broad range of environments, use-cases and industries such as in an enterprise business, research facility, educational institution, non-profit program, or open source project, to name a few.
This year's Duke's Choice Award goes to select group of innovators who's Java ecosystem contributions have improved the world around us. Oracle's Java Platform Group is proud to give recognition to:
Oracle's Java Platform Group is thankful for the wide variety of Java technology usage in the broad developer ecosystem and is looking forward to recognizing future winners in 2020.
Python Re * – The Asterisk Quantifier for Regular Expressions
Every computer scientist knows the asterisk quantifier of regular expressions. But many non-techies know it, too. Each time you search for a text file *.txt on your computer, you use the asterisk operator.
This article is all about the asterisk * quantifier in Python’s re library. Study it carefully and master this important piece of knowledge once and for all!
Alternatively, you can also watch the video where I lead you through the whole article:
What’s the Python Re * Quantifier?
When applied to regular expression A, Python’s A* quantifier matches zero or more occurrences of A. The * quantifier is called asterisk operator and it always applies only to the preceding regular expression. For example, the regular expression ‘yes*’ matches strings ‘ye’, ‘yes’, and ‘yesssssss’. But it does not match the empty string because the asterisk quantifier * does not apply to the whole regex ‘yes’ but only to the preceding regex ‘s’.
Let’s study two basic examples to help you gain a deeper understanding. Do you get all of them?
>>> import re
>>> text = 'finxter for fast and fun python learning'
>>> re.findall('f.* ', text)
['finxter for fast and fun python ']
>>> re.findall('f.*? ', text)
['finxter ', 'for ', 'fast ', 'fun ']
>>> re.findall('f[a-z]*', text)
['finxter', 'for', 'fast', 'fun']
>>>
Don’t worry if you had problems understanding those examples. You’ll learn about them next. Here’s the first example:
Greedy Asterisk Example
>>> re.findall('f.* ', text)
['finxter for fast and fun python ']
You use the re.findall() method. In case you don’t know it, here’s the definition from the Finxter blog article:
The re.findall(pattern, string) method finds all occurrences of the pattern in the string and returns a list of all matching substrings.
The first argument is the regular expression pattern ‘f.* ‘. The second argument is the string to be searched for the pattern. In plain English, you want to find all patterns in the string that start with the character ‘f’, followed by an arbitrary number of optional characters, followed by an empty space.
The findall() method returns only one matching substring: ‘finxter for fast and fun python ‘. The asterisk quantifier * is greedy. This means that it tries to match as many occurrences of the preceding regex as possible. So in our case, it wants to match as many arbitrary characters as possible so that the pattern is still matched. Therefore, the regex engine “consumes” the whole sentence.
Non-Greedy Asterisk Example
But what if you want to find all words starting with an ‘f’? In other words: how to match the text with a non-greedy asterisk operator?
In this example, you’re looking at a similar pattern with only one difference: you use the non-greedy asterisk operator *?. You want to find all occurrences of character ‘f’ followed by an arbitrary number of characters (but as few as possible), followed by an empty space.
Therefore, the regex engine finds four matches: the strings ‘finxter ‘, ‘for ‘, ‘fast ‘, and ‘fun ‘.
This regex achieves almost the same thing: finding all words starting with f. But you use the asterisk quantifier in combination with a character class that defines specifically which characters are valid matches.
Within the character class, you can define character ranges. For example, the character range [a-z] matches one lowercase character in the alphabet while the character range [A-Z] matches one uppercase character in the alphabet.
But note that the empty space is not part of the character class, so it won’t be matched if it appears in the text. Thus, the result is the same list of words that start with character f: ‘finxter ‘, ‘for ‘, ‘fast ‘, and ‘fun ‘.
What If You Want to Match the Asterisk Character Itself?
You know that the asterisk quantifier matches an arbitrary number of the preceding regular expression. But what if you search for the asterisk (or star) character itself? How can you search for it in a string?
The answer is simple: escape the asterisk character in your regular expression using the backslash. In particular, use ‘\*’ instead of ‘*’. Here’s an example:
You find all occurrences of the star symbol in the text by using the regex ‘\*’. Consequently, if you use the regex ‘\**’, you search for an arbitrary number of occurrences of the asterisk symbol (including zero occurrences). And if you would like to search for all maximal number of occurrences of subsequent asterisk symbols in a text, you’d use the regex ‘\*+’.
[Collection] What Are The Different Python Re Quantifiers?
The asterisk quantifier—Python re *—is only one of many regex operators. If you want to use (and understand) regular expressions in practice, you’ll need to know all of them by heart!
So let’s dive into the other operators:
A regular expression is a decades-old concept in computer science. Invented in the 1950s by famous mathematician Stephen Cole Kleene, the decades of evolution brought a huge variety of operations. Collecting all operations and writing up a comprehensive list would result in a very thick and unreadable book by itself.
Fortunately, you don’t have to learn all regular expressions before you can start using them in your practical code projects. Next, you’ll get a quick and dirty overview of the most important regex operations and how to use them in Python. In follow-up chapters, you’ll then study them in detail — with many practical applications and code puzzles.
Here are the most important regex quantifiers:
Quantifier
Description
Example
.
The wild-card (‘dot’) matches any character in a string except the newline character ‘n’.
Regex ‘…’ matches all words with three characters such as ‘abc’, ‘cat’, and ‘dog’.
*
The zero-or-more asterisk matches an arbitrary number of occurrences (including zero occurrences) of the immediately preceding regex.
Regex ‘cat*’ matches the strings ‘ca’, ‘cat’, ‘catt’, ‘cattt’, and ‘catttttttt’.
?
The zero-or-one matches (as the name suggests) either zero or one occurrences of the immediately preceding regex.
Regex ‘cat?’ matches both strings ‘ca’ and ‘cat’ — but not ‘catt’, ‘cattt’, and ‘catttttttt’.
+
The at-least-one matches one or more occurrences of the immediately preceding regex.
Regex ‘cat+’ does not match the string ‘ca’ but matches all strings with at least one trailing character ‘t’ such as ‘cat’, ‘catt’, and ‘cattt’.
^
The start-of-string matches the beginning of a string.
Regex ‘^p’ matches the strings ‘python’ and ‘programming’ but not ‘lisp’ and ‘spying’ where the character ‘p’ does not occur at the start of the string.
$
The end-of-string matches the end of a string.
Regex ‘py$’ would match the strings ‘main.py’ and ‘pypy’ but not the strings ‘python’ and ‘pypi’.
A|B
The OR matches either the regex A or the regex B. Note that the intuition is quite different from the standard interpretation of the or operator that can also satisfy both conditions.
Regex ‘(hello)|(hi)’ matches strings ‘hello world’ and ‘hi python’. It wouldn’t make sense to try to match both of them at the same time.
AB
The AND matches first the regex A and second the regex B, in this sequence.
We’ve already seen it trivially in the regex ‘ca’ that matches first regex ‘c’ and second regex ‘a’.
Note that I gave the above operators some more meaningful names (in bold) so that you can immediately grasp the purpose of each regex. For example, the ‘^’ operator is usually denoted as the ‘caret’ operator. Those names are not descriptive so I came up with more kindergarten-like words such as the “start-of-string” operator.
We’ve already seen many examples but let’s dive into even more!
import re text = ''' Ha! let me see her: out, alas! he's cold: Her blood is settled, and her joints are stiff; Life and these lips have long been separated: Death lies on her like an untimely frost Upon the sweetest flower of all the field. ''' print(re.findall('.a!', text)) '''
Finds all occurrences of an arbitrary character that is
followed by the character sequence 'a!'.
['Ha!'] ''' print(re.findall('is.*and', text)) '''
Finds all occurrences of the word 'is',
followed by an arbitrary number of characters
and the word 'and'.
['is settled, and'] ''' print(re.findall('her:?', text)) '''
Finds all occurrences of the word 'her',
followed by zero or one occurrences of the colon ':'.
['her:', 'her', 'her'] ''' print(re.findall('her:+', text)) '''
Finds all occurrences of the word 'her',
followed by one or more occurrences of the colon ':'.
['her:'] ''' print(re.findall('^Ha.*', text)) '''
Finds all occurrences where the string starts with
the character sequence 'Ha', followed by an arbitrary
number of characters except for the new-line character. Can you figure out why Python doesn't find any?
[] ''' print(re.findall('n$', text)) '''
Finds all occurrences where the new-line character 'n'
occurs at the end of the string.
['n'] ''' print(re.findall('(Life|Death)', text)) '''
Finds all occurrences of either the word 'Life' or the
word 'Death'.
['Life', 'Death'] '''
In these examples, you’ve already seen the special symbol ‘\n’ which denotes the new-line character in Python (and most other languages). There are many special characters, specifically designed for regular expressions. Next, we’ll discover the most important special symbols.
What’s the Difference Between Python Re * and ? Quantifiers?
You can read the Python Re A? quantifier as zero-or-one regex: the preceding regex A is matched either zero times or exactly once. But it’s not matched more often.
Analogously, you can read the Python Re A* operator as the zero-or-more regex (I know it sounds a bit clunky): the preceding regex A is matched an arbitrary number of times.
The regex ‘ab?’ matches the character ‘a’ in the string, followed by character ‘b’ if it exists (which it does in the code).
The regex ‘ab*’ matches the character ‘a’ in the string, followed by as many characters ‘b’ as possible.
What’s the Difference Between Python Re * and + Quantifiers?
You can read the Python Re A* quantifier as zero-or-more regex: the preceding regex A is matched an arbitrary number of times.
Analogously, you can read the Python Re A+ operator as the at-least-once regex: the preceding regex A is matched an arbitrary number of times too—but at least once.
The regex ‘ab*’ matches the character ‘a’ in the string, followed by an arbitary number of occurrences of character ‘b’. The substring ‘a’ perfectly matches this formulation. Therefore, you find that the regex matches eight times in the string.
The regex ‘ab+’ matches the character ‘a’, followed by as many characters ‘b’ as possible—but at least one. However, the character ‘b’ does not exist so there’s no match.
What are Python Re *?, +?, ?? Quantifiers?
You’ve learned about the three quantifiers:
The quantifier A* matches an arbitrary number of patterns A.
The quantifier A+ matches at least one pattern A.
The quantifier A? matches zero-or-one pattern A.
Those three are all greedy: they match as many occurrences of the pattern as possible. Here’s an example that shows their greediness:
The code shows that all three quantifiers *, +, and ? match as many ‘a’ characters as possible.
So, the logical question is: how to match as few as possible? We call this non-greedy matching. You can append the question mark after the respective quantifiers to tell the regex engine that you intend to match as few patterns as possible: *?, +?, and ??.
Here’s the same example but with the non-greedy quantifiers:
In this case, the code shows that all three quantifiers *?, +?, and ?? match as few ‘a’ characters as possible.
Related Re Methods
There are five important regular expression methods which you should master:
The re.findall(pattern, string) method returns a list of string matches. Read more in our blog tutorial.
The re.search(pattern, string) method returns a match object of the first match. Read more in our blog tutorial.
The re.match(pattern, string) method returns a match object if the regex matches at the beginning of the string. Read more in our blog tutorial.
The re.fullmatch(pattern, string) method returns a match object if the regex matches the whole string. Read more in our blog tutorial.
The re.compile(pattern) method prepares the regular expression pattern—and returns a regex object which you can use multiple times in your code. Read more in our blog tutorial.
The re.split(pattern, string) method returns a list of strings by matching all occurrences of the pattern in the string and dividing the string along those. Read more in our blog tutorial.
The re.sub(The re.sub(pattern, repl, string, count=0, flags=0) method returns a new string where all occurrences of the pattern in the old string are replaced by repl. Read more in our blog tutorial.
These seven methods are 80% of what you need to know to get started with Python’s regular expression functionality.
Where to Go From Here?
You’ve learned everything you need to know about the asterisk quantifier * in this regex tutorial.
Summary: When applied to regular expression A, Python’s A* quantifier matches zero or more occurrences of A. The * quantifier is called asterisk operator and it always applies only to the preceding regular expression. For example, the regular expression ‘yes*’ matches strings ‘ye’, ‘yes’, and ‘yesssssss’. But it does not match the empty string because the asterisk quantifier * does not apply to the whole regex ‘yes’ but only to the preceding regex ‘s’.
Want to earn money while you learn Python? Average Python programmers earn more than $50 per hour. You can certainly become average, can’t you?
Join the free webinar that shows you how to become a thriving coding business owner online!