I have a paragraph like,
“Vicky is going to shop
And he bought apple for 1kg
The price $10
In price : (A to Z) he sell $12”
In price : (A to Z) he sell is constant
The amount will be dynamic.
I need to extract the amount $12
What is the Regex expression I need to use here
You can use this pattern.
(?<=In price \: \(A to Z\) he sell).*
I just did a minor update on Omer’s regex. I included the space character after the words “he sell”. So that it will just pick only $12 and not include the space before it.
Here’s the updated regex:
(?<=In price : (A to Z) he sell ).*
You can try with Regex Expression
System.Text.RegularExpressions.Regex.Match(YourString,"(?<=In\sprice\s:\s\(A to Z\)\she\ssell\s)(\D.+)").Tostring
Try this regex pattern
Try this split alternative too
Split(txt,"In price : (A To Z) he sell")(1)
Split(txt," ")(Split(txt," ").Count-1)
@Vicky_K try this regex
“(?<=In price : (A to Z) he sell)[$0-9\s]+”
Sreejith S S