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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:31:47+00:00 2026-06-09T07:31:47+00:00

I am having problems trying to extract the correct value from a text I

  • 0

I am having problems trying to extract the correct value from a text

I want to extract 14.50 from the following text (which is the last decimal number in the string).

string

<span class="ob-pricedetails">Price:</span> &#036;57.71<span style="color: #666666; font-size: 12px;">(&#163;37.61)</span><br/><span style="font-size: 11px; color: #000000;">Shipping (UK):</span>&#036;14.50

I have been trying to use the following regex

regex

(?<=Shipping \(UK\):<\/span>&#163;|&#036;)(.*)

which returns the following result for some strange reason

57.71<span style="color: #666666; font-size: 12px;">(&#163;37.61)</span><br/><span style="font-size: 11px; color: #000000;">Shipping (UK):</span>&#036;14.50

What am I doing wrong? any help would be appreciated.

  • 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-09T07:31:50+00:00Added an answer on June 9, 2026 at 7:31 am

    This would work:

    preg_match('/Shipping \(UK\):<\/span>&#036;([0-9]+\.[0-9]+)/', $html, $matches);
    

    Of course you should listen to everyone suggesting yo use a DOM parser instead of regular expressions.

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

Sidebar

Related Questions

I am having real problems trying to extract the text between a HTML header
I am having problems trying to do the following. I am trying to incorporate
I'm trying to extract all words from a string into an array, but i
I've been having problems trying to retrieve data from my database to a DataTable
Accomplished pulling data from JSON, but having problems trying to pull additional information from
I am having problems trying to use a different MySQL database engine. (I want
I'm having problems trying to make a reactive form. When I insert data into
I am having problems trying to load libpng in my native android project. It
I'm having problems trying to adjust the width of a column of a datagrid.
Hello I am new at Haskell and i'm having problems trying to get this

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.