There’s a table in which there’s a ‘Remarks’ column.
There can be multiple rows in this ‘Remarks’ column.
My requirement is i am supposed to loop through the rows and find if any number is present in the remarks. For example:10
The moment i find the number i will break the loop.
Sometimes this ‘Remarks’ coulumn can have date value.For example 12/12/2022. The date can be present in any format.
If the remarks is having only date value then i should not consider that row.
But sometimes the ‘Remarks’ coulumn can have the date value along with number. This number can be present before or even after date value.
In this case I am supposed to fetch the number.
Currently i am facing challenge in getting this number when date value is also there.
It’s fetching incorrect number.
Thank you @Anil_G for the quick reply.
The date format can be any.
Just wanted to know in case if date format is 20-Oct-2022 instead 20/10/2022 then how to generalise the regex pattern which you have suggested.
^\d+\s - Matches number at start with a space between next characters
\s\d+$ - Matches number at end with a space between previous characters
^\d+$ - Only a number from start to end of string
Thank you for explaining.
Just one last question,
so in the process suppose say this condition met then i m supposed to capture this value and move ahead
the regex which you have provided now if i use in ‘If condition’ then it shows string cannot be converted to boolean.
How can i convert this string to boolean.
As i mentioned in my query if only the value is present irrespective of date then i should break the loop else i need to continue the loop.
Thanks for the reply @Anil_G
I tried to use your solution.
It works fine when the value is after date.
But if the value is before date then its giving incorrect result.
For example if Remark is :
“Line limit is 10 on 12 oct 2020”
then value getting extracted is 2020 instead of 10
Similarly if remarks is as follows:
“Line limit is 10 on 12/12/2020”
then value is not getting extracted
Hi @Anil_G Its a Remarks column in a table where some remarks will be there. That remark may just contain date/value/date and value
Need to extract that value if there.
For example some sample values shown as below:
Remarks
Line limit is 10 on 3/10/2022
New line on 5 oct 2022 is 2
Line is 20 as on 3/15/2020
approved lines on 2 jan 2020 is 30
line value is 25
Date is 23/3/2022
Only value i should extract. If some remarks row is having only date then i should skip that row
Thanks @Anil_G . It’s working. I just added space character before * which initially i had not.
If possible can you please explain this piece of regex.
Regex i have not worked as such before. Does space character also has some importance?
Okay thats the reason i added apace to check for 0 or more spaces …if you have removed then the expression is |* which is invalid…pipe is like a or condition and * is for one or more …
| * means previous expression or space 0 or more times