Skip to content

Commit

Permalink
Fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardconstantin committed May 20, 2024
1 parent b4614b1 commit a5bf023
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/graphql/repoQuestions.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//const url = "https://raw.githubusercontent.com/Ditectrev/Microsoft-Azure-AZ-900-Microsoft-Azure-Fundamentals-Exam-Questions-Answers/main/README.md";

const scrapeQuestions = (markdownText: string) => {
const regex =
/### (.*?)\s*\n\n((?:\!\[.*?\]\(.*?\)\s*\n\n)*?)((?:- \[(?:x| )\] .*?\n)+)/gs;
const optionsRegex = /- \[(x| )\] (.*?)(?=\n- \[|$)/g;
/### (.*?)\s*\r?\n\r?\n((?:\!\[.*?\]\(.*?\)\s*\r?\n\r?\n)*?)((?:- \[(?:x| )\] .*?\r?\n)+)/gs;

const optionsRegex = /- \[(x| )\] (.*?)(?=\r?\n- \[|$)/g;
const imageRegex = /\!\[(.*?)\]\((.*?)\)/g;
const questions = [];
let match;
Expand Down

0 comments on commit a5bf023

Please sign in to comment.