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

  • SEARCH
  • Home
  • 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 7516533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:09:39+00:00 2026-05-30T01:09:39+00:00

What’s wrong with this set of RegEx /^[\p{L}\p{N}]+/u . When my senior entered %

  • 0

What’s wrong with this set of RegEx /^[\p{L}\p{N}]+/u. When my senior entered % openminded The regex return false. I need it to accept this format

% openminded
100% openminded
openminded 100%

What do I need to add in the expression? So that it will accept the input even if the user entered % at first or any special character.

  • 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-30T01:09:41+00:00Added an answer on May 30, 2026 at 1:09 am

    The percent sign is not a \pS symbol. It’s a \pP punctuation, as explained by uniprops:

    $ uniprops %
    U+0025 ‹%› \N{PERCENT SIGN}
        \pP \p{Po}
        All Any ASCII Assigned Basic_Latin Common Zyyy Po P Gr_Base Grapheme_Base Graph GrBase Other_Punctuation Punct Pat_Syn Pattern_Syntax PatSyn POSIX_Graph POSIX_Print POSIX_Punct Print Punctuation X_POSIX_Graph X_POSIX_Print X_POSIX_Punct
    

    You should familiarize yourself with the general category (and perhaps script) that your favorite characters belong to. Here’s some sample output from running unichars:

    $ unichars -gs '[\pP\pS]' '\p{Block=Basic_Latin}'
    U+0021 ‭ !  GC=Po SC=Common       EXCLAMATION MARK
    U+0022 ‭ "  GC=Po SC=Common       QUOTATION MARK
    U+0023 ‭ #  GC=Po SC=Common       NUMBER SIGN
    U+0024 ‭ $  GC=Sc SC=Common       DOLLAR SIGN
    U+0025 ‭ %  GC=Po SC=Common       PERCENT SIGN
    U+0026 ‭ &  GC=Po SC=Common       AMPERSAND
    U+0027 ‭ '  GC=Po SC=Common       APOSTROPHE
    U+0028 ‭ (  GC=Ps SC=Common       LEFT PARENTHESIS
    U+0029 ‭ )  GC=Pe SC=Common       RIGHT PARENTHESIS
    U+002A ‭ *  GC=Po SC=Common       ASTERISK
    U+002B ‭ +  GC=Sm SC=Common       PLUS SIGN
    U+002C ‭ ,  GC=Po SC=Common       COMMA
    U+002D ‭ -  GC=Pd SC=Common       HYPHEN-MINUS
    U+002E ‭ .  GC=Po SC=Common       FULL STOP
    U+002F ‭ /  GC=Po SC=Common       SOLIDUS
    U+003A ‭ :  GC=Po SC=Common       COLON
    U+003B ‭ ;  GC=Po SC=Common       SEMICOLON
    U+003C ‭ <  GC=Sm SC=Common       LESS-THAN SIGN
    U+003D ‭ =  GC=Sm SC=Common       EQUALS SIGN
    U+003E ‭ >  GC=Sm SC=Common       GREATER-THAN SIGN
    U+003F ‭ ?  GC=Po SC=Common       QUESTION MARK
    U+0040 ‭ @  GC=Po SC=Common       COMMERCIAL AT
    U+005B ‭ [  GC=Ps SC=Common       LEFT SQUARE BRACKET
    U+005C ‭ \  GC=Po SC=Common       REVERSE SOLIDUS
    U+005D ‭ ]  GC=Pe SC=Common       RIGHT SQUARE BRACKET
    U+005E ‭ ^  GC=Sk SC=Common       CIRCUMFLEX ACCENT
    U+005F ‭ _  GC=Pc SC=Common       LOW LINE
    U+0060 ‭ `  GC=Sk SC=Common       GRAVE ACCENT
    U+007B ‭ {  GC=Ps SC=Common       LEFT CURLY BRACKET
    U+007C ‭ |  GC=Sm SC=Common       VERTICAL LINE
    U+007D ‭ }  GC=Pe SC=Common       RIGHT CURLY BRACKET
    U+007E ‭ ~  GC=Sm SC=Common       TILDE
    

    So either add the right general category to your class, like

     [\pL\pN\p{Po}]
    

    or just add the specific character you need. BTW, anything that wants \pL almost always also wants \pM, too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.
In my XML file chapters tag has more chapter tag.i need to display chapters
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms

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.