|
|
Browse by Tags
All Tags » html
Showing page 1 of 5 (48 total posts)
-
Hello,
I'm looking for a pattern that extracts the attributes inside an html element string
I came up with the following:
/<font\s[^>]*face="(.*?)" size="(.*?)" color="(.*?)"[^>]*>(.*?)<\/font>/si
but what if not all 3 attributes face, font and size are required?
is it possible to ...
-
I want to change a font element to an XHTML compatible variant.
e.g.
find
<font face="arial" size="1"
color="red" >hello world</font>
replace
<span
style='font-family: arial; font-size: 1; color: red;'>hello
world</span>
note:
- the font attributes can change order
- ...
-
I'm in perl, trying to write a regex that will remove line breaks from between <a> tags, so that a later regex can extract data from links, for example my current data looks like this:
<a href='http://www.website.com' class='blah'>This is a
website</a>
And want to turn it into:
<a ...
-
Hi,
I have hundreds of links on a website that were manually programmed in HTML as hyperlinks. Our designer informed me that they shouldn't be links, so rather than line by line remove the <A> element from my code I'm looking to use the Regular Expression search and replace function within my development IDE to resolve this issue ...
-
I'm trying to find words in HTML that are between tags using PHP (v5.2.6) preg_replace.
The following rules apply to the matches
full word match only (can also be matched when adjacent to non-word characters such as commas, parenthesis, periods, question marks, exclamation marks, percentage, dollar signs)
e.g. "test" would ...
-
Hi, I have for example the following string:
<!-- google_ad_section_start -->Some text bla bla!<!-- google_ad_section_end -->
Now I need a regex to only find the last comment, but only if the string ends with a comment (maybe followed by some white spaces). If there is somebody asking for the sense of this, I need to add a read more ...
-
Hi, im new to regular expressions, and have a questions. How do i go about getting data between HTML tags ? eg:
<pos>1234.000 2345.000 567.000</pos>
I've tried both of these: ^\Q<b>\E[\d\w\s]+\Q</b>\E and (?>=^|>)[^><]+?(?=<|$) , But neither of them work how i need them to. The ...
-
Hello!
I'm using PHP and I need to find all the XHTML tags that aren't closed (or open) properly in a text.
For example, in this text I need to match the tag <strong> to remove it:
<p>This is an <strong>error</p> I thought it would be easy, just an assertion-related problem, and I created this ...
-
Hello RegexAdvice users.
I am at this time trying to update my template system, and i have desidet to use regex insted of ALOT of explodes :D
I this i will start out with showing you what my templates look like.
code:<html>
<head>
<title>Some test</title>
</head>
<body>
<php:if ...
-
I hoped that the answer to my last question would be enough of a hint to solve the following problem but I still don't get it how to negate a part of the expression or maybe there is a better solution...
Still using PCRE in PHP. I'm parsing an html document. My goal is to extract some data from a table that meets certain conditions:
- id ...
1
|
|
|