Skip to main content
Mythos

Regular Expressions

Regular expressions are patterns used to match character combinations in strings, according to MDN Web Docs, which documents their syntax and use in 📝JavaScript.

In JavaScript, MDN notes, regular expressions are also objects. A pattern can be written as a literal enclosed between slashes, such as /ab+c/, which is compiled when the script is loaded, or built with the RegExp constructor, which compiles it at runtime and suits patterns that change or come from another source, such as user input. Patterns are used with the exec() and test() methods of RegExp and with String methods including match(), replace(), search() and split().

MDN describes a pattern as composed of simple characters, such as /abc/, which match only that exact sequence, or a combination of simple and special characters. It groups the special characters into four categories: assertions, which include boundaries marking the beginnings and endings of lines and words; character classes, which distinguish types of characters such as letters and digits; groups and backreferences; and quantifiers, which indicate numbers of characters or expressions to match. Optional flags add functionality such as global and case-insensitive searching.

Rubular describes itself as "a Ruby-based regular expression editor" and "a handy way to test regular expressions as you write them": the user enters a regular expression and a test string. Its page carries a regex quick reference and states that it uses Ruby 2.5.9. Further notes on the subject sit in the 📝Regex memo.

https://rubular.com/

Contexts

MythOS is a product of Cooperating Citizens of One, Inc.

TermsPrivacyRefundsContact

© 2026 Cooperating Citizens of One, Inc. · MythOS since 2017 · Not affiliated with Anthropic.