Answer the question
In order to leave comments, you need to log in
How to fix the regular expression? Or how do you know where it's wrong?
1} Site link
https://readmanga.me/stat_avantiuristom____kak_pro...
Code =REGEXEXTRACT( INDEX(IMPORTHTML(B7;"table";0);2;1); ".*?\-.*?(\d+ )" )
ND Error
Should output Number 15. Located at the bottom at the beginning of the table.
2} Site link
https://mintmanga.live/since_i_received_a_cheat_an...
Code =REGEXEXTRACT(INDEX(IMPORTHTML(B31;"table";0);2;1);".*?\d+\s*\-. *?(\d+)")
ND error.
Should produce Word Extra. It is located at the bottom of the table.
Spreadsheet https://docs.google.com/spreadsheets/d/13lzkFlnGGB...
Location of errors 1{b8} 2{b32}
I will be glad if you tell me what characters I need.
Answer the question
In order to leave comments, you need to log in
https://regex101.com/ convenient and highlight, and allow you to compare the regular expression with your text samples
There, in the text, there are newline characters "\n", and in the construction .*
, the dot matches any characters except "\n". In order for the dot to match the newline characters, just add (?s)
Instead of ".*?\-.*?(\d+)" put "(?s).*?\-.*?(\d+)" or " (?s)-.*?(\d+)"
(\d+) only matches numbers, so the word Extra won't match the pattern ".*?\d+\s*\-.*?(\d+)".
You can try this pattern "\d+\s*(?:-\s*)?(.+)"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question