Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Regular Expressions
  4. Why regular expression doesn't work in Java 11

Why regular expression doesn't work in Java 11

Scheduled Pinned Locked Moved Regular Expressions
regexjavaphpcomsysadmin
1 Posts 1 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    iceja
    wrote on last edited by
    #1

    I have the regular expression:

    ^Статья\s(?\p{N}+)\.?\s(?.+)</pre>

    and a string:

    <pre>Статья 1. Цели и сфера применения технического регламента</pre>

    When I run here https://regex101.com/ (FLAVOR PCRE2 (PHP >= 7.3) - it does work well. But when I run this regular expression in
    <pre>
    root@b2fa9e8a6f7d:/app# java --version
    openjdk 11.0.11 2021-04-20
    OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
    OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)</pre>

    pattern.matcher(string) returns null which is wrong. Please tell me how to fix that? Or can you give me a manual about Regular Expressions dialects ?

    FLAVOR PCRE2 (PHP >= 7.3) was selected intentionally because Flavor Java 8 is completely incompatible with AdoptOpenJDK-11.0.11+9</x-turndown>

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups