Link1: Mamaearth Perfume Body Mist for Babies and Kids with Allergen Free Jasmine Fragrance for All Day Freshness 150 ml : Amazon.in: Baby Products
Link2: Lavie Sport Camo 34 Ltrs Casual Backpack | School College bag for Boys & Girls (Navy) : Amazon.in: Fashion
what i need is to extract the ASIN number from particular products but everytime the position is getting changed of the ASIN number
how to extract the ASIN number if any one of the format comes. main goal is to extract the ASIN number
Jobin_Joy
(Jobin Joy)
December 20, 2021, 12:54pm
2
Hi @Vinit_Mhatre
Can you try using Regular Expression to achieve your goal?
This CheatSheet introduces the basic use of regex functions. With further examples also special cases are presented.
Introduction
From the namespace System.Text.RegularExpressions following methods are offered:
Regex.Match
Regex.Matches
Regex.isMatch
Regex.Replace
Regex.Split
A simple usage for example would look like this:
[grafik]
Recommendation:
add System.Text.RegularExpressions to the imports:
[grafik]
it allows to use the shortened statement, as the namespace part can be ommited…
Thank you.
Jobin_Joy
(Jobin Joy)
December 20, 2021, 1:01pm
3
Here is RegEx Pattern for your requirement.
Extract the entire string as stored it in a variable then apply the below pattern, It will work with both the cases I seen in the initial post.
Note: Trim any empty spaces on both ends if needed.
Hope this will be helpful. Thank you.
tst.txt (843 Bytes)
This is my extracted file can you give me the regex to extract the ASIN number from this… ASIN number should be only 10 char. so also add the limit of 10 char in regex
Thanks
Hi @Vinit_Mhatre ,
Can you try using Regular Expression for your solution.
System.Text.RegularExpressions.Regex.Match(str,“(?<=ASIN :\s)[A-Za-z0-9]{10}”).Value.Trim