-1

Bascom uses a special format to comment out blocks of code. I want a RegEx that matches this block to be used in SyntaxHighlighter.

These comment blocks starts with '( and ends with '). Yep, it's so stupid.

Example input:

    bla
    '(
    test
    test
    ')
    blubb

I tried: '\(.*?\)' and many others without success.

Expected return after replace:

    bla
    #####
    blubb

where ##### is the replacement.

Basically just like C++ & similar /* .. */ rule. But I can't get it working.

Thanks in advance!

tightDev
  • 11
  • 2

1 Answers1

-1

const data = `    bla
    '(
    test
    test
    ')
    blubb`

const result = data.replace(/'\([\s\S]*?'\)/g, "#######");
console.log(result);

Edit: Please, give an explanation for the down-vote.

Alireza
  • 625
  • 4
  • 16
  • 1
    I haven't downvoted. Sadly, my reputation is too low for upvoting. It works perfectly, many thanks! – tightDev Aug 12 '19 at 09:29