How to match only those values which contains .00 using Regular Expression? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Sabestian Caine
Posts: 473
Joined: 12 Apr 2015, 03:53

How to match only those values which contains .00 using Regular Expression?

08 Aug 2020, 04:21

I have these long strings-




01-01-2017 DL592585 01234567890123 INR SIA RAM KUMAR By Cash 30,000.00 C VERIFIED L06123 T65432 CASH
01-01-2017 DL592585 01234567890123 INR SIA RAM KUMAR HARE RAMA11 5,000.00 C VERIFIED L06123 T65432 CASH



I have a very long such kind of list and i want to get only amount i.e. 30,000.00 and 5,000.00 so on.
So I want such kind of RegEx codes which should only match the digits which contains .00

I tried with these codes but they are not working properly-

Code: Select all

RegExMatch(value, "im)\d+(\d\.00)",obj)
Please help me..

Thans a lot..
I don't normally code as I don't code normally.
YOU do what YOU want, but happens what HE wants.
YOU do what HE wants, will happen what YOU want.
User avatar
boiler
Posts: 5919
Joined: 21 Dec 2014, 02:44

Re: How to match only those values which contains .00 using Regular Expression?

08 Aug 2020, 04:59

For one thing, you need to allow for the presence of a comma.

Code: Select all

RegExMatch(value, "m)(\d+,)?\d{1,3}\.00", obj)
Note that i isn’t needed as an option since there are no letters for case sensitivity to matter. The m option doesn’t really matter here either. Also, you named the resulting match variable obj, but it’s not an object with the options chosen. It’s just a string.
User avatar
Sabestian Caine
Posts: 473
Joined: 12 Apr 2015, 03:53

Re: How to match only those values which contains .00 using Regular Expression?

08 Aug 2020, 05:14

boiler wrote:
08 Aug 2020, 04:59
For one thing, you need to allow for the presence of a comma.

Code: Select all

RegExMatch(value, "m)(\d+,)?\d{1,3}\.00", obj)
Note that i isn’t needed as an option since there are no letters for case sensitivity to matter. The m option doesn’t really matter here either. Also, you named the resulting match variable obj, but it’s not an object with the options chosen. It’s just a string.
Thanks dear boiler for your great help...
Sir, one more thing-

your codes are working on small amounts perfectly, but when the amounts are bigger like-

01-01-2017 DL592585 01234567890123 INR SIA RAM KUMAR By Cash 2,90,000.00 C VERIFIED L06123 T65432 CASH
01-01-2017 DL592585 01234567890123 INR SIA RAM KUMAR HARE RAMA11 89,55,000.00 C VERIFIED L06123 T65432 CASH


then they are not working. in the above example they are not matching 2,90,000.00 and 89,55,000.00

Please solve this problem too.
Thank you sir..
I don't normally code as I don't code normally.
YOU do what YOU want, but happens what HE wants.
YOU do what HE wants, will happen what YOU want.
User avatar
boiler
Posts: 5919
Joined: 21 Dec 2014, 02:44

Re: How to match only those values which contains .00 using Regular Expression?  Topic is solved

08 Aug 2020, 05:35

Just change the ? to a *.

By the way, it seems strange that there are commas separating only two digits in your examples.
User avatar
Sabestian Caine
Posts: 473
Joined: 12 Apr 2015, 03:53

Re: How to match only those values which contains .00 using Regular Expression?

08 Aug 2020, 05:47

boiler wrote:
08 Aug 2020, 05:35
Just change the ? to a *.

By the way, it seems strange that there are commas separating only two digits in your examples.
Yes sir, it is Indian currency system which appears like this-
08_08_20 @4_15_40.PNG
08_08_20 @4_15_40.PNG (6.98 KiB) Viewed 1075 times
Anyway, thanks a lot for your great help and support... :thumbup: :bravo:
I don't normally code as I don't code normally.
YOU do what YOU want, but happens what HE wants.
YOU do what HE wants, will happen what YOU want.
User avatar
boiler
Posts: 5919
Joined: 21 Dec 2014, 02:44

Re: How to match only those values which contains .00 using Regular Expression?

08 Aug 2020, 05:52

I see. I wasn’t aware. Please excuse my ignorance.

Return to “Ask For Help”

Who is online

Users browsing this forum: armoz, Bing [Bot], mikeyww and 52 guests