Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6377889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:55:58+00:00 2026-05-25T01:55:58+00:00

When using this regex /^[\p{L}\p{N}. -/\\]+$/u in php I get an ‘internal error while

  • 0

When using this regex /^[\p{L}\p{N}. -/\\]+$/u in php I get an ‘internal error while using the pattern’ error. It want the matched string to be able to contain backslashes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:55:59+00:00Added an answer on May 25, 2026 at 1:55 am
    $str = '\\';    // = \
    $str = '\\\\';  // = \\ (this is what you need for your regex)
    

    So, knowing that, your current regex compiles to:

    /^[\p{L}\p{N}. -/\]+$/u
    

    which escapes the “]” character and breaks the regex.

    Also your delimiter character “/” and “-” should be escaped inside the regex.

    Corrected version:

    $regex = '/^[\p{L}\p{N}. \\-\\/\\\\]+$/u';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I get the percentage and filesize from this sort of string using
I'm using RegEx to get specific parts of a file via PHP! Let me
i'm using regex to get some information from a website, i have this code:
anyone have any experience using this? if so, is it worth while?
I have borrowed code from this link PHP regex templating - find all occurrences
I'm using this code to find all interesting links in a page: soup.findAll('a', href=re.compile('^notizia.php\?idn=\d+'))
Okay, I am a noob to regex, and I am using this site for
I am trying to parse text for email id's using php / regex. Are
Here is what I am trying to achieve in PHP: I have this string:
I'm using this jquery plugin: https://github.com/maranomynet/linkify/blob/master/1.0/jquery.linkify-1.0.js With this REGEX plugins I'm trying to linkify

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.