Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Prism and Some Thoughts On Regex
Abdur-Rahmaan Janhangeer
Abdur-Rahmaan Janhangeer

Posted on

     

Prism and Some Thoughts On Regex

i was browsing the site ofprism.js when i saw this:

Parsers fail on incorrect syntax, where regular expressions keep matching.

the author was explaining one of the decisions taken namely to use regular expressions. but, the statement above is flawed for two points

  • Parsers fail on incorrect syntax
  • regex have no link to parsers

Do Parsers Fail On Incorrect Syntax?

that one is an easy one. can't we write parsers that keep going? this point is cleared by the second one

Are Regex Different From Parsers?

regex are just another way to describe patterns be it large pieces of string like a language or just a simple piece of string like finding an email address in a paragraph.

books on compiler theory sometimes use regex instead of BNF to describe elements. looking from another angle, how does regex work, is it some native language to the computer? no, a parser has been written to understand regex and accomplish the underlying matching.

Conclusion

natural language parsing offers some interesting reflections from time to time. here is a case of the author trying to say: 'it works, let it be'

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Cruising python seas. Independent Py Dev
  • Location
    Mauritius
  • Work
    Independent Py Dev at MyOwnAccount
  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp