http://olx.ua/obyavlenie/ischu-otdelnuyu-komnatu-dlya-dolgosrochnoy-arendy-IDmQ5Is.html Need to get mQ5Is . Well, advise what to read, so as not to ask such banal questions.
http://olx.ua/obyavlenie/ischu-otdelnuyu-komnatu-dlya-dolgosrochnoy-arendy-IDmQ5Is.html Need to get mQ5Is . Well, advise what to read, so as not to ask such banal questions.
Once the top-starter has arranged the suggested comment, I am writing it as an answer.
Template : (?<=-ID).+(?=\.html)
Demonstration : https://regex101.com/r/qX8eT4/1

This regular expression searches for text between -ID and .html . True, if the link somewhere already has a combination of symbols -ID , then on this link the pattern will no longer work - https://regex101.com/r/qX8eT4/2 . I hope that the author of the question will not have such links.
.+ - any character other than line breaks repeated 1 or more times.
-ID and \.html are literals -ID and .html respectively. The point before html must be escaped, so that it acts as a literal and does not consume text, where instead of a point there is any character other than line IDSashaBrilliantFhtml , like IDSashaBrilliantFhtml or IDSashaBrilliant7html - https://regex101.com/r/qX8eT4/3 .
?<= and ?= - operators look back and look forward, respectively. We found the expression -IDSashaBrilliant.html , but we do not need -ID and .html ; in order not to consume them, these context search operators are applied.
You can read about context searching in Ben Fort's book Regular Expressions. 10 minutes to class ” , lesson 9, page 111.
Source: https://ru.stackoverflow.com/questions/561142/
All Articles