Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Commit

Permalink
The dots after am and pm are optional
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmelon54 committed Apr 28, 2021
1 parent 8db07f5 commit 5e1064c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/ChatData.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ class ChatData {

ChatData.loadFile = contents=>{
const lines=contents.split('\n');
const regexOne = /^\[?(?<date>[0-9]{2}\/[0-9]{2}\/[0-9]{4}|[0-9]{4}-[0-9]{2}-[0-9]{2}), (?<time>[0-9]{1,2}\:[0-9]{2}(?:\:[0-9]{2})?(?: [ap]\.m\.)?)(?:\]| \-) (?<data>.+)$/;
const regexOne = /^\[?(?<date>[0-9]{2}\/[0-9]{2}\/[0-9]{4}|[0-9]{4}-[0-9]{2}-[0-9]{2}), (?<time>[0-9]{1,2}\:[0-9]{2}(?:\:[0-9]{2})?(?: [ap]\.?m\.?)?)(?:\]| \-) (?<data>.+)$/;
const regexTwo = /^(?<name>.+?)\: (?<message>.+)$/;
const str = contents;
let lastDate = "";
let m;

let messages = [];

for(let i=0;i<lines.length;i++) {
let line=lines[i];
let m = regexOne.exec(line);
Expand Down

0 comments on commit 5e1064c

Please sign in to comment.