There is such a regular season - (\d*) грн|руб|р.|\$\U
It should parse the full price with a currency like - 500 руб . But instead, I will receive only the currency itself, that is, the руб . What is the problem?
There is such a regular season - (\d*) грн|руб|р.|\$\U
It should parse the full price with a currency like - 500 руб . But instead, I will receive only the currency itself, that is, the руб . What is the problem?
Here is another option:
/\$\d+(?:\.\d+)?|\d+(?:\.\d+)?\x20+(?:грн|руб|р.|\$)/iu Test here: https://regex101.com/r/hD3qA8/1
\$\d+(?:\.\d+)? - capture prices in dollars of the form: $100 , $99.99
\d+(?:\.\d+)?\x20+(?:грн|руб|р.|\$) - capture prices with leading digits + from 1 to infinity gaps + name of the currency.
PS If you need a group to capture, then after / put an opening parenthesis and a closing /iu close.
Source: https://ru.stackoverflow.com/questions/545218/
All Articles
(\d*)\s(грн|руб|р.)something like that. - pavel