Forum Discussion
New Regular expression (Regex) functions in Excel
SergeiBaklan PerrySjogren_JoeMcDaid
Hi Perry / Jake
Why not introduce a RegexPattern function which can refer a cell and tell us the Regex pattern used there. It can work like CHAR() and CODE() works. One can find the regex pattern of the text to be found and then use that pattern in other Regex functions to get the desired results.
Kanwaljit
- SergeiBaklanMay 29, 2024Diamond Contributor
But used pattern is not hided. It is within the cell, or text within REGEX..., or returned by some function. In any case it's available.
- KanwalNo1May 29, 2024Iron Contributor
The actual purpose of such a function is to find the Regular Expression which need to used to get the format like that.
E.g., RegexExtract(B2, "[A-z]+ [A-z]+",1) is required to find the name Sonia Rees from text given in Cell B2
What RegexPattern() intends to do is that If I Type Sonia Rees in Cell B1 and then use the formula RegexPattern(B1) in Cell C1, it gives me the Result "[A-z]+ [A-z]+"
Here any non-technical person can make use of the Other Regex functions efficiently because we don't even have to search anywhere else for the pattern expressions.
Just Like =CODE("x") gives us the value 120 and we can use =Char(120) to generate x
Regards
Kanwaljit
- SergeiBaklanMay 30, 2024Diamond Contributor
I see. Looks like RegEx generator. Not simple task.