regex for a string ,\"16 questions\", -


i not in regex , spent time figure out how search below pattern:

,\"16 questions\", 

this constructed .\"[0-9,]+ questions\".
think close not sure how much. can please correct it. numeric value can have comma in when number crosses 1k. e.g 2,500 questions.

,"\d{1,3}(,\d{3,3})*\squestions?", 

explanation:

  • \d{1,3}= 1~3 decimal digits
  • (,\d{3,3})* = comma , 3 decimal digits, whole group repeating 0~n times
  • \s = whitespace
  • s? = letter s can missing

these 2 parts give accurate recognition of possible numbers.

test , visualization.

if backslashes in text true backslashes, regex including them be

,\\"\d{1,3}(,\d{3,3})*\squestions?\\", 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -