Regex Needed

:64:C230524INR157912788,10 Output I want 157912788,10
:61:2305240524C117612788,10NTBI//TBI
I want I want different different things as output
TBI
NTBI
117612788,10
Please give me 3 different query for this

@Kuldeep_Pandey

Can you please specify what are the static parts in it and what are the dynamic parts?

For the first if inr is static then just split with inr and you would get the value

Cheers

Query 1: Extract “157912788,10” from “:64:C230524INR157912788,10”

Assign (output = System.Text.RegularExpressions.Regex.Match(inputString, “(?<=:64:C)\d+,\d+”).Value)

Query 2: Extract “TBI” from “:61:2305240524C117612788,10NTBI//TBI”

Assign (output = System.Text.RegularExpressions.Regex.Match(inputString, “(?<=//)[A-Za-z]+”).Value)

Query 3: Extract “117612788,10” from “:61:2305240524C117612788,10NTBI//TBI”

Assign (output = System.Text.RegularExpressions.Regex.Match(inputString, “(?<=C)\d+,\d+”).Value)

1 Like

Regex1: Extract “NTBI” from “:61:2305240524C117612788,10NTBI//TBI”

System.Text.RegularExpressions.Regex.Match(InputString,“(?<=,[0-9].)(.{4})”).Value

Regex2: Extract “157912788,10” from “:64:C230524INR157912788,10”

System.Text.RegularExpressions.Regex.Match(inputString,“(?<=INR).*”).value

1 Like

:61:2305230523C32048006,74NTCI//TCI
Please give me query for 2 things also 230523 for this
32048006,74 for this in the statement

static tag is there only amounts changes

:61:2305230523C32048006,74NTCI//TCI
Please give me query for 2 things also 230523 for this
32048006,74 for this in the statement
U can try for this

@Kuldeep_Pandey

  1. Extract “TBI” from the input “:61:2305240524C117612788,10NTBI//TBI”:

Regular Expression: (?<=NTBI\/\/)[A-Za-z]+

Explanation: This regular expression captures the characters immediately following “NTBI//” in the input string.

  1. Extract “NTBI” from the input “:61:2305240524C117612788,10NTBI//TBI”:

Regular Expression: [A-Za-z]+(?=\/\/TBI)

Explanation: This regular expression captures the characters immediately preceding “//TBI” in the input string.
3. Extract “117612788,10” from the input “:61:2305240524C117612788,10NTBI//TBI”:

outputString = inputString.Split("C"c)(1);

String Manipulation: Split the input string using “C” as the delimiter and take the second part.

Hi @Kuldeep_Pandey

Below are following regex expressions to extract the following output from given input. Refer the screenshots below for the regex expression.



Hope it helps!!

Regards,