Skip to content

Regex with the 's' flag does not match newlines with '.' #1847

Closed
@MasseGuillaume

Description

@MasseGuillaume

scala

scala> val that = """|<p><code>
                     |List(1)
                     |</code></p>""".stripMargin
scala> "(?s).*<code>(.*?)</code>.*".r.pattern.matcher(that).matches()
res1: Boolean = true

vs
scalajs

dom.console.log("(?s).*<code>(.*?)</code>.*".r.pattern.matcher(that).matches()) // false

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateDuplicate of another issue. Closed.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions