0

I have the following input

st="""
I need 2 position Urgent 400-500$. It would be a
Programmer($ 500 ~ $ 1000) or Software and Business Analyst Manager salary in range 1k-1.2k with IT Manager Urgent 900-1,000$ 3 positions 3positions 
"""

and I want to get only salary I have tried pattern in https://regex101.com/r/owE3A3/5 it produced the result what I want, but when I implemented on Python it seems not work with Negative Lookahead expression. Here is my snippet

pattern= re.compile(r'(?!(\d\s*?positions?))[0-9]?[0-9,.]+')
print(pattern.findall(st))
#output ['', '', '', '', '', '', '', '']

could you give some advice to ignore digits with specific string? any answers would be appriciated

Sovary
  • 642
  • 4
  • 11
  • 1
    See [this demo](https://ideone.com/RFJezs). Just as at regex101. Do not add capturing groups if you do not need the submatches and only need whole match values. – Wiktor Stribiżew Jul 19 '17 at 12:22
  • 1
    `re.findall` returns all capturing groups instead of fullmatches if capturing groups are involved. Either use non-capturing groups, capture what you want or use `re.finditer` to access the ful match object. – Sebastian Proske Jul 19 '17 at 12:22

0 Answers0