0

So, given the following data:

7,True,15841380011.5677
50,True,1584138379.370037
51,True,1584138409.370671
52,True,1584138439.371
52,True,1584138469.372058
53,True,1584138499.372796
100,True,158420000

I am trying to find a regex that matches three parts of the data:

First: The beginning is a number between 0 and 100 (with no leading zeros), then followed by a comma.

Second: Next is always True or False, followed by a comma

Third: The data entry ends with an integer or decimal number (its a datetime stamp).

How can I regex out these values into three variables, while making sure they are in this format I described above? Assume you always operate on only one line of data, not on the whole block, as this is processed in a loop that split the data after each line.

Wiktor Stribiżew
  • 484,719
  • 26
  • 302
  • 397
n00b.exe
  • 217
  • 3
  • 9
  • Looks like you are looking to create a regex, but do not know where to get started. Please check [Reference - What does this regex mean](https://stackoverflow.com/questions/22937618) resource, it has plenty of hints. Also, refer to [Learning Regular Expressions](https://stackoverflow.com/questions/4736) post for some basic regex info. Once you get some expression ready and still have issues with the solution, please edit the question with the latest details and we'll be glad to help you fix the problem. – Wiktor Stribiżew Mar 13 '20 at 22:59
  • ^([1-9]\d*),(True|False),(\d+(\.\d+)?)$ – MDR Mar 13 '20 at 23:06
  • 1
    https://regex101.com/r/2ZfKHD/1 - this is better ^([1-9]|[1-9][0-9]|100),(True|False),(\d*(\.\d+)?)$ – MDR Mar 13 '20 at 23:46

0 Answers0