scalafiddle / scalafiddle-core

Source code for the scalafiddle.io compilation service
https://scalafiddle.io
Apache License 2.0
101 stars 37 forks source link

Regular expression checking doesn't work with string anchors #30

Closed jclem closed 6 years ago

jclem commented 6 years ago

In ScalaFiddle, this is None (see https://scalafiddle.io/sf/amxlC9O/0):

"""\Ahello""".r.findFirstIn("hello")

In Scastie, it's Some(hello): https://scastie.scala-lang.org/ZUmFJMFgSNaGA2nrRXrUkA

ochrons commented 6 years ago

Scala.js uses JS regex engine, so it's not the same as on JVM.

jclem commented 6 years ago

Oh whoops, I didn't realize that ScalaFiddle uses Scala.js.

ochrons commented 6 years ago

There aren't many things that work differently from JVM, but regexes are one of them (for performance reasons) :)