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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:00:31+00:00 2026-06-04T22:00:31+00:00

I am looking to try an determine a regular expression to parse out the

  • 0

I am looking to try an determine a regular expression to parse out the interior url from this google alert redirect

http://www.google.com/url?sa=X&q=http://weheartit.com/entry/29409069&ct=ga&cad=CAcQARgAIAEoATAAOABAo5aK_gRIAlgBYgVlbi1VUw&cd=jRWL16jvo8k&usg=AFQjCNGbJMqWtbCxpcJdu4PGD6RToU6NTw

What I need to do is remove the first part that is

http://www.google.com/url?sa=X&q=

And I would also remove the trailing string which is

&ct=ga&cad=CAcQARgAIAEoATAAOABAo5aK_gRIAlgBYgVlbi1VUw&cd=jRWL16jvo8k&usg=AFQjCNGbJMqWtbCxpcJdu4PGD6RToU6NTw

So the ending url I would end with is

http://weheartit.com/entry/29409069

I just wanted to update this thanks for the help. This was an issue in the link module for drupal and it has been fixed

  • 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-06-04T22:00:34+00:00Added an answer on June 4, 2026 at 10:00 pm

    Still unclear what you are trying to accomplish, whether it’s extracting or removal of the surrounding parts, it’s not really difficult:

    preg_match('#q=(http://[^&]+)#', $source, $result);
    print $result[1];
    

    Or otherwise:

    = preg_replace('#^.+q=([^&]+).+$#', '$1', $source);
    

    Would work.

    • See also Open source RegexBuddy alternatives and Online regex testing for some helpful tools, or RegExp.info for a nicer tutorial.

    And again, the alternative lies in parse_url and parse_str

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

Sidebar

Related Questions

I'm looking to try out JRuby and JRuby on Rails. I'm having trouble finding
I'm looking to parse UTF8 characters from the standard output stream of another application
I'm looking to try to make an efficient delete method to work on a
I'm looking to turn off try blocks for a specific JSP page (though turning
I am looking at creating a web site and I want to try and
I'm looking at the Android Camera code, and when I try importing android.os.SystemProperties ,
I'm looking to translate words by letters/vowels. I'll try to explain. I have a
Looking to move data from a table A to history table B every X
I'm on Mac OS X (Objective-C) and I'm looking for a way to determine
Is anyone aware of any methodology to try and determine the method and instance

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.