Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Browse by Tags

All Tags » HTML
Showing page 1 of 6 (55 total posts)
  • Parsing html input value attribute

    HTML Input may or may not have value attribute which may or may not have actual value. Sample subject string   <input type="text" tabindex="1" name="username" id="username" size="25" value="" class="inputbox autowidth" /><input type="password" ...
    Posted to Construction Advice (Forum) by blarg on April 22, 2013
  • gawk: multiple replacement of different regexp's

    This is my task: I have written lots of texts that I transform into HTML code, TeX code or other "printing languages" using an Gawk script (I work on a Windows computer using cygwin for Unix-like tasks like running shell scripts). Within the text special characters are coded in a special way so they can be replaced with codes which ...
    Posted to Construction Advice (Forum) by Daniel on March 12, 2011
  • match optional fields

    I have a fields that looks like this <div class="some">   <h2>title</h2>    <p>text text</p>     <table>         <tr class="some1"><td>data1</td><td>d1 ...
    Posted to Construction Advice (Forum) by Aradiv on March 9, 2011
  • Find and Replace A HTML Tag That Spans Multiple-lines

    Hello everyone! I have 2000 HTML files thats I need to change a <div> tag into a <h1> tag. This find and replace has to change the opening and closing tags for <div class='title'>....</div> so thats its <h1 class='title'>.....</h1> The difficult part about this is I don't want to affect the ...
    Posted to Construction Advice (Forum) by cyberad on February 3, 2011
  • Got (X)HTML? Use the DOM

    By far the most common request I see in people wanting regex help is someone wanting to use a regex to parse HTML.  Generally I ignore those questions.  If I do respond, my response is “Don’t use a regex to parse HTML. Use the HTML DOM” Same is true for XML, with the XML DOM, but doing it for HTML is even ...
    Posted to Michael Ash's Regex Blog (Weblog) by mash on January 23, 2011
  • My regex won't match correctly when input is on a single line

    Hello, I am trying to build a regex to extract 0 or more matched strings from HTML-formatted input. I am developing on the .NET Framework 3.5 in C#. I have been using to build my regex (and use the generated code to verify results). I am using the case-insensitive option. The input will contain 0 or more entries ...
    Posted to Construction Advice (Forum) by gator on October 11, 2010
  • converting self-closing xhtml tags to html

    I have a CMS which is written to output xhtml.  I am trying to write a php script that will convert the system - completely and permanently - to output html instead.  The sticking point is creating a regex to find self-closing xhtml tags (e.g., <img /> ) and convert them to non-self-closing html tags (e.g., <img>).  I am ...
    Posted to Construction Advice (Forum) by traq on August 17, 2010
  • fetching attributes

    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 ...
    Posted to Construction Advice (Forum) by iCon on July 11, 2010
  • <font> to <span>

    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 - ...
    Posted to Construction Advice (Forum) by iCon on July 8, 2010
  • Removing line breaks between <a> HTML tags

    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='' class='blah'>This is a website</a> And want to turn it into: <a ...
    Posted to Construction Advice (Forum) by Rohaq on March 23, 2010
1 2 3 4 5 Next > ... Last ยป