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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:27:58+00:00 2026-05-13T05:27:58+00:00

Hey Guys I Am Trying To Use One Regex Pattern If And Else //$pattern

  • 0

Hey Guys I Am Trying To Use One Regex Pattern If And Else

//$pattern    = "%http://depositfiles.com/[a-z]{2}/files/[0-9-a-z-A-z]*%";
//$pattern    = "%http://depositfiles.com/files/[0-9-a-z-A-z]{9}%";

i just want to use one regex pattern to match the depositfiles

$subject = 'http://depositfiles.com/files/9178jwt09 http://depositfiles.com/en/files/9178jzt09';
$pattern = '%http://depositfiles.com/files/[a-z]{2}(?=a-z]{2}/)then|(?![0-9-a-z-A-z]{9})else)%';

preg_match_all($pattern,$subject,$array);
print_r($array);

result if it works :

Array ( [0] => Array ( [0] => http://depositfiles.com/files/9178jzt09  [1]) =>  http://depositfiles.com/en/files/9178jzt09)

so i just need one regex pattern to define the 2 subjects thanks cheers.

  • 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-13T05:27:58+00:00Added an answer on May 13, 2026 at 5:27 am

    Would this work for you?

    $subject = 'http://depositfiles.com/files/9178jwt09 http://depositfiles.com/en/files/9178jzt09';
    $pattern = '_http://depositfiles.com/(?:[a-z]{2}/)?files/[0-9a-zA-Z]{9}_';
    preg_match_all($pattern,$subject,$array);
    print_r($array[0]);
    

    Output:

    Array
    (
        [0] => http://depositfiles.com/files/9178jwt09
        [1] => http://depositfiles.com/en/files/9178jzt09
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I have a problem (again). This time I am trying to use
Hey guys. I'm trying to configure TFS2010 on a home server. I want to
Hey guys, i'm trying to use the following drawing logic: Class Game { Character
Hey guys, I am trying to build an app that will use a compass
Hey guys i wrote a quick test. I want delete to call deleteMe which
Hey guys, I want to ask if there is an equivalent to the @@DBTS
Hey guys, I'm trying to make a small addition to a web app I
Hey guys, I'm trying to compute the cumulative distribution function of the standard normal
Hey guys, I'm trying to get my head around LINQ and FP, so forgive
Hey guys, I'm starting with Zend, and trying to understand the way it works

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.