|
the regex:
<br />
# Region<br />
<tr><br />
\s*<td\s+class="grey11">Region:</td>\s*<br />
<td\s+class="b11\s+b">(?<Region>.+?(?=</td>))</td><br />
\s*<br />
</tr><br />
\s*<br />
<br />
</table><br />
\s*<br />
<br />
#Optional AD<br />
(<br />
<div\s+class="wid342\s+fl\s+padtop15"><br />
\s*<br />
<div\s+class="linkicon\s+listicon\s+lh16"><br />
\s*<br />
<a(?:[^>]*?)><br />
(?:.+?)</a>\s*</div>\s*</div><br />
){0,1}<br />
<br />
</div><br />
\s*<br />
<br />
(<br />
# Amenities<br />
<div\s+class="wid342\s+fl\s+mtop10(?:[^>]*?)><br />
\s*<br />
<div\s+class="pad10"><br />
(?:.+?)<br />
<ul\s+class="chkbox"><br />
(?<Amenities>.+?)<br />
</ul><br />
\s*<br />
</div><br />
){0,1}<br />
<br />
<br />
<br />
(?:.+?)<br />
<br />
#Extra<br />
(<br />
<div\s+class="b10\s+lh16\s+vpad10"><br />
\s*(?<Extra>.+?)\s*<br />
</div><br />
){0,1}<br />
the text:
<tr>
<td class="grey11">Drive</td>
<td class="b11">Front</td>
</tr>
<tr>
<td class="grey11">Transm</td>
<td class="b11 b">Mech</td>
</tr>
<tr>
<td class="grey11">Intr</td>
<td class="b11">Leather</td>
</tr>
<tr>
<td class="grey11">COND/td>
<td class="b11">USED</td>
</tr>
<tr>
<td class="grey11">Region/td>
<td class="b11 b">QQQQQQQQQQQQQ</td>
</tr>
</table>
</div>
<div class="wid342 fl mtop10" style="background:#F5F5F5">
<div class="pad10">
<h4 class="darkred">What's inside</h4>
<ul class="chkbox">
<li class="par">
<ul>
<li>ABS</li>
<li>Acs</li>
<li>HUD</li>
<li>Immo</li>
</li>
<li class="par">
<ul>
<li>Chairs</li>
<li>Alarm</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="wid342 fl oh">
<p class="vmargin10">
<h4>Extra info</h4>
<div class="b10 lh16 vpad10">
Good condition. Assembled in ---------
</div>
Why doesn't it return me "Good condition. Assembled in ---------" for "Extra" group? This group is
actually optional; that's why I marked it with {0,1}. And if I remove {0,1} the regex returns me it's expected value but only in this particular case.
What's wrong to my regex?
|
|
|
|
|
No idea what the answer to the question is, however....
Don't use a regex in an attempt to parse html/xml. Instead use a parser. Such parsers already exist and have an extensive history.
At best regex solutions can only work if all of the following are true
1. The source is machine generated
2. The source is limited to a single source (or perhaps two.)
3. There is no chance that any other source will ever be used.
If the above are not all true then the result will be one of the following
1. Over time one will end up with a full functioning parser (which would have been the case if one started with one in the first place.)
2. Over time one will end up with a hideous unmanagable mess of code that must be replaced - probably with a parser.
|
|
|
|
|
Can we use google charts in php for creating Stock Charts ? and what is imagecreate in php can I use this for create run time charts ?
|
|
|
|
|
|
|
funny I was just looking at that - it's a great resource. (Although, it looks like it only produced swf files (objects) not images - so I turned it down. I needed to be able to embed graphs into a pdf dynamically - which i can do with fpdf and images but not swfs.)
|
|
|
|
|
Thanks for your help but i don't want to create chart with the help of flash I don't like it at all and amCharts is better than others for creating run time charts like intraday stock charts etc. if there is any other program for creating charts then suggest me.
Thank You
|
|
|
|
|
Here is the example of google line chart you can add some more things in it as you required
http://chart.apis.google.com/chart?cht=lc&chs=200x125&chd=t:40,60,60,45,47,75,70,72
just past it in your browser for preview
now can i use this in php and if yes then can you give me two like example because i am beginner in php.
|
|
|
|
|
|
|
http://chart.apis.google.com/chart?cht=lc&chs=200x125&chd=t:40,60,60,45,47,75,70,72
please try this
|
|
|
|
|
|
Thanks for your help it is very impressive chart but i need line chart brother.No problem brother Thanks again
|
|
|
|
|
|
How to open .php file in php or How to run .php file from php ? example :-- there is two php file ram.php and shyam.php.Now i want to open shyam.php in ram.php or write a command which can run shyam.php from ram.php
|
|
|
|
|
include [^] or require [^] depending on how you want to handle errors.
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Hi
Is there any gui tool like Toad for mysql in linux.
I have the gui toos from mysql but its not comfortable.
I want a smart guitool.
Saadhinchaali
|
|
|
|
|
Sorry - don't know what toad is, but if you've got access to Apache, you could try phpMyAdmin to get a nice web interface (with the advantage of external access).
Kev
|
|
|
|
|
What about Squirrel SQL or Tora? Those are mentioned in the first hits when I google for sql frontend linux.
Cheers,
Sebastian
--
"If it was two men, the non-driver would have challenged the driver to simply crash through the gates. The macho image thing, you know." - Marc Clifton
|
|
|
|
|
If you are comfortable with Toad, you can try to use it under Linux with Wine[^] (an integrated Windows emulator).
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
What about MySQL's browser and admin?
I find them sufficient. Not perfect, but will do the job
Where it seems there are only borderlines, Where others turn and sigh, You shall rise!
|
|
|
|
|
So, as many people have stated before, I'm really new to php and programming as a whole. But, I'm trying to start with the easy stuff when it comes to making small tweaks to my site. I want to change some text (a few words at the most) that is on the site now but I can't find where it is. I've searched the files individually offline using a "find" function but I can't locate the text I'm looking for. Ideally, I would like to make the changes directly on myphpadmin. Any advice out there? Thanks.
|
|
|
|
|
if the text is stored in a database it is likely it is stored as "BLOB". Which means editing requires file uploads etc which can be a pain. What you need to do is find the file that calls the database for the particular piece of text. then you will know exactly what you are looking for in phpmyadmin and whether or not you can edit it easily. i suggest updating it through use of a csv/sql file import or better still code a page that will let you edit what's in the database. it was one of the first things I learnt how to do with PHP.
|
|
|
|
|
i copied some code off the net and when saving the file in kate i get this message: You are trying to save a python file as non ascii, without specifying a correct source encoding line for encoding utf-8. Say what? Like i'm new to linux but i'm not new to computers and i have no idea what this means. options are insert coding or save nevertheless. The problem is i can;t alter the code the compiler says syntax error every time. Is that why? the utf-8 encoding?
|
|
|
|
|
The file you are trying to save contains non-ASCII data.
Call it "binary" data if it's clearer.
That's why Kate asks you about the encoding and the compiler fails.
You should hunt the non-ASCII data down and remove it, then you'll be ok.
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|