Python Forum
Here what is the meaning of span=(1,2) ,match='1'?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Here what is the meaning of span=(1,2) ,match='1'?
#1
I just want to know what is the meaning of span=(1,2) ,match='1'
import re
print(re.search(r'[0-9]','$100'))
Output:
<re.Match object; span=(1, 2), match='1'>
Reply
#2
[0-9] Matches one digit from zero to nine

re.search(r'[0-9]','$100') Searches for a digit in string '$100'

match='1' First digit matched is one

span=(1, 2) Matched digit start at position one. $ is at position zero
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to understand the meaning of the line of code. jahuja73 0 274 Jan-23-2024, 05:09 AM
Last Post: jahuja73
  Csv writer meaning of quoting mg24 2 1,106 Oct-01-2022, 02:16 PM
Last Post: Gribouillis
  meaning of -> syntax in function definition DrakeSoft 5 1,879 Apr-09-2022, 07:45 AM
Last Post: DrakeSoft
  Operator meaning explanation Sherine 3 1,980 Jul-31-2021, 11:05 AM
Last Post: Sherine
  parser.parse_args() meaning vinci 2 2,551 Oct-26-2020, 04:13 PM
Last Post: vinci
  What is the meaning of k in this function? giladal 3 2,653 Aug-15-2020, 12:32 PM
Last Post: buran
  What is the meaning of mutable data type? qliu 3 2,876 Apr-17-2020, 07:20 PM
Last Post: deanhystad
  iterating a span of a list Skaperen 5 2,997 Dec-29-2019, 08:15 PM
Last Post: Skaperen
  Upper-Bound Exclusive Meaning Johnny1998 1 3,313 Aug-02-2019, 08:32 PM
Last Post: ichabod801
  Span columns with docxTemplate python jimmeh 4 4,227 May-29-2019, 04:40 PM
Last Post: heiner55

Forum Jump:

User Panel Messages

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