0
print(re.search(r'\b\w+\b', '\t hell0_there(0,1) \tbbb'))     # Works fine - 'hell0_there'
print(re.search(r'\S+', '  hell0_there(0,1)\t bbb'))          # Works fine - 'hell0_there(0,1)'

print(re.search(r'\b\S+\b', '  hell0_there(0,1)  '))      # Missing paranthesis - 'hell0_there(0,1'
print(re.search(r'\b\S+\b','   1.3.6.1.4.1.9848.3.2.2.3(1,0)   ')) # Missing closed paranthesis

print(re.search(r'\b\S+\b', '\t hell0_there(0,1) \tbbb'))      # Same issue
print(re.search(r'\b\S+\b','\t  1.3.6.1.4.1.9148.3.2.2.3(1,0)  \tnnn')) # Same issue

Why non-space boundary('\b\S+\b') does not extract with closed paranthesis?

overexchange
  • 15,768
  • 30
  • 152
  • 347

0 Answers0