Issue with Positive look ahead

i am not getting exact result of Positive Look ahead… can some one help me with this.

pattern:
“(?<=invoice number-\d± [A-Z]±)\w+(?=-)”
Text:
“invoice number-098888-JJHDR-INR-XJIE0R”

but i am not getting any result

@devasaiprasad_K

Please shate the sample input

pattern:
“(?<=invoice number-\d± [A-Z]±)\w+(?=-)”
Sample Input:
“invoice number-098888-JJHDR-INR-XJIE0R”

Hi @devasaiprasad_K

Can you share the expected output.

Regards

@devasaiprasad_K

Please share output also

@devasaiprasad_K

(?<=invoice\s*number\-\d+\s*\-[A-Z]+\-)\w+(?=\-)


I do some changes in the regex hope it works for you

Hi @devasaiprasad_K

Check out the below regex if this is the output needed.

(?<=invoice number\-\d+\-?[A-Z]+\-)\w.*

or this:

(?<=invoice number\-\d+\-?[A-Z]+\-)\w+(?=-)

Regards

Hi @devasaiprasad_K

(?<=invoice\snumber\-\d+\-[A-Z]+\-)\w+(?=-)

let me correct the INput
“invoice number-098888-JJHDR-INR-90000”

now i need amount after INR… how many digits it could be

Hi @devasaiprasad_K

Try this

(?<=INR.)(\d+)

1 Like

Hi @devasaiprasad_K

Try this:

(?<=invoice number\-\d+\-?[A-Z]+\-\w+\-?)\d+

Regards

1 Like

@devasaiprasad_K


(?<=invoice\snumber\-\d+\-[A-Z]+\-\w+\-)\d+

1 Like

@devasaiprasad_K

Hi @devasaiprasad_K

If the regular expression works for you, please mark my post as solution to close the loop or if you have any queries, I’m happy to help.

Regards

thanks for the shortest sol

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.