Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

104
Views
monaco-editor tokenizer do not support "ignore case" regex

The tokenizer in monaco-editor do not seem to support 'ignore case' i flag in regex. Sample code below,

To replicate, you can paste this in playground and try running yourself.

monaco.languages.register({ id: 'sample' });
monaco.languages.setMonarchTokensProvider('sample', {
    tokenizer: {
        root: [
            [/cmd1|cmd2/i, 'keyword']
        ]
    }
});

monaco.editor.create(document.getElementById('container'), {
    value: "cmd1 10\nCMD2 10",
    language: 'sample'
});

cmd1 turns blue while CMD2 do not.

Is this intentional? Is there a way around?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Adding ignoreCase:true to the options should work.

Editor Reference

monaco.languages.register({ id: 'sample' });
monaco.languages.setMonarchTokensProvider('sample', {
    ignoreCase:true,
    tokenizer: {
        root: [
            [/cmd1|cmd2/, 'keyword']
        ]
    }
});

monaco.editor.create(document.getElementById('container'), {
    value: "cmd1 10\nCMD2 10",
    language: 'sample'
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!