@SASdevAnneMarie wrote: Do you know please how to add the condition and in this expression, like "/\b2,25|\b2\.25|\b1,75|\b1\.75/ and 'RATE'".
So you want to check if a string contains one (or more) of the numbers discussed previously and also the string "RATE" (or "'RATE'" with single quotes? Perhaps case-insensitive?)?
You could search for "RATE" with a separate function call (e.g., of the FINDW function). However, if you know positively that "RATE" would always occur before (or always after) the number, you can add it conveniently to the regular expression:
"/\bRATE\b.*(\b2,25|\b2\.25|\b1,75|\b1\.75)/i"
This regex matches RATE, rate, Rate, etc. (but not Strategy, rated, etc.), followed by a word boundary and a sequence of (zero or more) virtually arbitrary characters and then any of the four numbers of interest. So, example strings matching this pattern are
Rate:1,75
The rate is exactly 2.25%.
estimated rate: 1.737 (95%-CI: 1.716-1.758)
The latter match could be avoided by adding \b metacharacters after the numbers, but then 2.250 etc. would no longer match (without further extensions of the regex).
... View more