Need Regex for string

Hi Team,
“jgfrujdb uubgdnmd\r\nPlan\r\n9 US: Missouri\r\nAMB# 002915\r\nNAIC# 27642\r\nFEIN# 431427497\r\nei\r\nA gio Q * ki igi\r\nHome Recent Company My Industry Industry\r\nActivity Search Companies Research News”,

in this string i need - ‘002915’ and ‘Home Recent Company My Industry Industry’ for this please send regex

Note: Please don’t attach screenshot, please send Regex

@Gandham_Jyothi

Welcome to the community

can you please let us know which are the static parts in this given string

for number: (?<=AMB# )\d{6}

for name : (?<=FEIN# (.*\n){2}).*

cheers

@Anil_G
All are Dynamic strings only

@Gandham_Jyothi

Try above if that works…else if eevrything is dynamic then need more details about structure

will structure remain same?

cheers

@Gandham_Jyothi

for Number

system.text.regularexpression.regex.match(input,“(?<=nAMB#.)[0-9]+”).value

@Gandham_Jyothi

For Number: AMB#\s*(\d+)

(?<=\r\n)\w+(?: \w+)*

@Anil_G
this is not working
(?<=FEIN# (.\n){2}).

@rlgandu
AMB#\s*(\d+)

(?<=\r\n)\w+(?: \w+)*
this is also not working

@sasi_poosarla
AMB number working
Can you please provide for this string ‘Home Recent Company My Industry Industry’

@Gandham_Jyothi

@Gandham_Jyothi

Try this

(?<=FEIN# (.*\r?\n){2}).*

or

(?<=FEIN# (.*\r?\n){3}).*

cheers

Hi @Gandham_Jyothi
Use this regex in FInd Matching Patterns activity and store the output in First Match Property :

\b(?<=AMB#\s)(\d+)\b

Or
Use this in Assign activity:

strvar= "jgfrujdb uubgdnmd\r\nPlan\r\n9 US: Missouri\r\nAMB# 002915\r\nNAIC# 27642\r\nFEIN# 431427497\r\nei\r\nA gio Q * ki igi\r\nHome Recent Company My Industry Industry\r\nActivity Search Companies Research News,"
Match= System.Text.RegularExpressions.Regex.Match(strvar,"\b(?<=AMB#\s)(\d+)\b").Value

Refer this below image for better understanding.

Hope it helps!