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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:05:37+00:00 2026-05-15T22:05:37+00:00

I have two example filename strings: jquery.ui.min.js jquery.ui.min.css What regex can I use to

  • 0

I have two example filename strings:

jquery.ui.min.js
jquery.ui.min.css

What regex can I use to only match the LAST dot? I don’t need anything else, just the final dot.

A little more on what I’m doing. I’m using PHP’s preg_split() function to split the filename into an array. The function deletes any matches and gives you an array with the elements between splits. I’m trying to get it to split jquery.ui.min.js into an array that looks like this:

array[0] = jquery.ui.min
array[1] = js
  • 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-15T22:05:38+00:00Added an answer on May 15, 2026 at 10:05 pm

    I think you’ll have a hard time using preg_split, preg_match should be the better choice.

    preg_match('/(.*)\.([^.]*)$/', $filename, $matches);
    

    Alternatively, have a look at pathinfo.
    Or, do it very simply in two lines:

    $filename = substr($file, 0, strrpos($file, '.'));
    $extension = substr($file, strrpos($file, '.') + 1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two example. First is true and second is wrong. It's just different
I have two websites: http://example.com http://example.com/sub I have a page, let's say: http://example.com/sub/page1 Is
Possible Duplicate: Python, compute list difference I have two lists For example: A =
I have two html pages on my webserver www.example.com/desktop.html www.example.com/mobile.html In principle the content
I have two virtual hosts on windows(for example: test1.dev and test2.dev). But it always
We have two A records pointing to same public IP address as: www.example.com IN
I have two tables, for example: Table A Table B ======= ======= Name |
A have two entities. For example timing settings and orders. @Entity public class TimingSettings{
In the following example I have two years worth of data denoted by data_2007
I have two curves, one inside another, for example ellipse inside circle. I need

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.