cancel
Showing results for 
Search instead for 
Did you mean: 

extract substring using regex

Would be useful if the IsMatch function had a baby brother that could extract/return a substring from a parent string by using a regex pattern.  Either as a separate function or perhaps as an additional or optional output of the IsMatch function.

 

This is especially useful for strings that are variable where left/mid/right won't, but have predictable structure/patterns that regex can pick up.

 

 

 

Kind regards,

 

R

Status: Completed

We added the Match and MatchAll functions last year that can extract substrings based on regular expressions.

Comments
New Member

Like this functionality.  However, also would like to vet user input using a REGEX formula.  On match indicate to the user the input is a valid piece of data and alter App behaviour.   So could use access to the REGEX class, plugin, etc.

Power Apps
Status changed to: Under Review
 
Frequent Visitor

I could definitely use this if it works as javacript and others (i.e. "\d(\d)\d" than the 2nd digit can be referenced. 

Frequent Visitor

Would be very useful!

Kudo Kingpin

Yeah, I need a way to validate email input matches a certain pattern. 

Advocate I

I'm looking for a way to set a variable based on finding a code within a mail subject.

 

I think regex is ideal for this.

Regular Visitor

Looking for something similar. I'd like to look for text in a string, in most cases a url (i.e https://www.example.com/doc-456123 or https://www.example.com/doc-456123#step5), that contains "doc-" followed by and unspecified amount of numbers (i.e. doc-456123) and extract that specific match from the string

Super User III

If anyone is looking for an answer, here's an example that I've posted.

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/extract-substring-using-regex/m-p/7... 

 

 

 

Power Apps
Status changed to: Completed

We added the Match and MatchAll functions last year that can extract substrings based on regular expressions.

Regular Visitor

Awesome! Thanks!