Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address comments
  • Loading branch information
jdneo committed Mar 13, 2019
commit b39a46856c827bd342528b4521237ceeb7316739
11 changes: 4 additions & 7 deletions src/leetCodeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,10 @@ class LeetCodeManager extends EventEmitter {
}

private tryParseUserName(output: string): string {
const lines: string[] = output.trim().split(/\r?\n/);
if (lines.length === 3) {
const reg: RegExp = /^\s*.{1}\s*(.+)\s*https:\/\/leetcode/;
const match: RegExpMatchArray | null = lines[2].match(reg);
if (match && match.length === 2) {
return match[1].trim();
}
const reg: RegExp = /^\s*.\s*(.+?)\s*https:\/\/leetcode/m;
const match: RegExpMatchArray | null = output.match(reg);
if (match && match.length === 2) {
return match[1].trim();
}

return "Unknown";
Expand Down