Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Question about Expression
#1
If I have the following code:
import re
x = 'From [email protected] Sat Jan 5 09:14:16 2008'
y = re.findall('\S+?@\S+?', x)
print(y)

Why does it print 'stephen.marquard@u' not 'd@u', even though the non-greedy (?) is added to both sides?
Reply


Messages In This Thread
A Question about Expression - by IA22 - Aug-14-2020, 02:11 PM
RE: A Question about Expression - by Gribouillis - Aug-14-2020, 02:56 PM
RE: A Question about Expression - by stullis - Aug-14-2020, 04:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  regular expression question Skaperen 4 2,604 Aug-23-2021, 06:01 PM
Last Post: Skaperen
  Pass results of expression to another expression cmdr_eggplant 2 2,389 Mar-26-2020, 06:59 AM
Last Post: ndc85430
  regular expression question Sanlus 6 3,666 Aug-04-2018, 06:49 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020