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 7494595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:39:27+00:00 2026-05-29T17:39:27+00:00

I have a string JonSmith02-11-1955 I use preg_split to get JonSmith (reg='[0-9-]’) then do

  • 0

I have a string

“JonSmith02-11-1955”

I use
preg_split to get JonSmith (reg='[0-9-]’) then do it again (‘[a-zA-Z]\ ‘) to get his birthdate.
Is there any better way to get them both in one split ?

  • 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-29T17:39:33+00:00Added an answer on May 29, 2026 at 5:39 pm
    /(?<=[a-z])(?=\d)/i
    

    works in this case. It matches a position preceded by a letter and followed by a digit. Read about lookbehinds and -aheads for more information.

    This won’t work if the name can contain digits.

    DEMO

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

Sidebar

Related Questions

I have string like @2011-03-29 15:22:16 and I use dateformatter to get NSdate obj.
I have string in the following format. Option1:Option2:Option3:Option4 I want to get these items
I have: String.prototype.callcm = function(something[]){ alert(something); }; something.callcm({a:50,b:60}); how can the arguments with there
I have string Ärger,-Ökonom-i-Übermut-ẞ-ß and when I run IndexOf(--) I get a result of
Have string strng = <title>text1</title><title>text2</title>; How to get array like arr[0] = text1; arr[1]
I have String add_data[] = new String[6]; then I do System.out.println(COMPANY NAME: ); add_data[0]
I have string like this: Some standard text CONST_INSIDE_QUOTES blah blah CONST There might
I have string I'd like to escape for use in an XPath query. In
I have string. There are no items to show in this view of the
I have string like this /c SomeText\MoreText Some Text\More Text\Lol SomeText I want to

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.