Linked Questions
8,674 questions linked to/from RegEx match open tags except XHTML self-contained tags
29
votes
3answers
3k views
Writing regular expression in PHP to wrap <img> with <a> [duplicate]
I want to make it so that any occurance of an image gets wrapped with a link to the image source
How can I write a pattern, in PHP so that I can find these variations, which are scattered throughout ...
13
votes
3answers
18k views
Parsing XML in Python with regex [duplicate]
I'm trying to use regex to parse an XML file (in my case this seems the simplest way).
For example a line might be:
line='<City_State>PLAINSBORO, NJ 08536-1906</City_State>'
To access ...
0
votes
5answers
11k views
Regular expression for remove html links [duplicate]
Possible Duplicate:
Regular expression for parsing links from a webpage?
RegEx match open tags except XHTML self-contained tags
i need a regular expression to strip html <a> tags , here ...
7
votes
5answers
2k views
regular expression to remove links [duplicate]
Possible Duplicate:
RegEx match open tags except XHTML self-contained tags
I have a HTML page with
<a class="development" href="[variable content]">X</a>
The [variable content] is ...
8
votes
3answers
993 views
Regexp for html [duplicate]
Possible Duplicate:
RegEx match open tags except XHTML self-contained tags
I have the following string:
$str = "
<li>r</li>
<li>a</li>
<li>n</li>
<...
4
votes
3answers
8k views
Regular Expression to remove Div tags [duplicate]
I have a div tag, nested within many span and div tags.
Now I want a regular expression in JavaScript which will strip the div tags and get the content inside it.
9
votes
4answers
2k views
Regex - Convert HTML to valid XML tag [duplicate]
I need help writing a regex function that converts HTML string to a valid XML tag name. Ex: It takes a string and does the following:
If an alphabet or underscore occurs in the string, it keeps it
If ...
6
votes
3answers
10k views
Getting text from inside an HTML tag within a local file with grep [duplicate]
Possible Duplicate:
RegEx match open tags except XHTML self-contained tags
Excerpt From Input File
<TD class="clsTDLabelWeb" width="28%">Municipality: </TD>
<TD style="...
0
votes
3answers
2k views
Regular Expression (Regex) for HTML parsing in PHP [duplicate]
Possible Duplicate:
RegEx match open tags except XHTML self-contained tags
I'm stuck in weird regex problem, I'm parsing some HTML table in PHP.
RegEx I'm using : <td[^>]*>(h.*?)</td&...
2
votes
4answers
4k views
Building Regular Expression (RegEx) to extract text of HTML tag [duplicate]
I am trying to build a regular expression to extract the text inside the HTML tag as shown below. However I have limited skills in regular expressions, and I'm having trouble building the string.
...
1
vote
1answer
11k views
Regular Expression to match open and closed html tags [duplicate]
I want to come up with Regular Expression to return true if the a closed html tag is matched with an open one in specific text that gets passed in JavaScript. If there is an unmatched tag, it should ...
0
votes
3answers
3k views
Regexp to pull input tags out of form [duplicate]
I am trying to extract all the <input > tags out of a <form> tag. I have created a regexp which can identify the entire <form> tag and all the code up to the ending </form> but ...
0
votes
1answer
7k views
JAVA Regex to remove html tag and content [duplicate]
Possible Duplicate:
How to remove HTML tag in Java
RegEx match open tags except XHTML self-contained tags
I want to remove specific HTML tag with its content.
For example, if the html is:
<...
0
votes
2answers
1k views
Regex to strip tags, retain CDATA [duplicate]
Possible Duplicate:
RegEx match open tags except XHTML self-contained tags
Hi all,
I know how everyone loves a regex question, so here is mine. I have an XML tree within which some nodes contain ...
-1
votes
2answers
1k views
HOw to parse a div using Regular Expressions in java? [duplicate]
Possible Duplicate:
RegEx match open tags except XHTML self-contained tags
I am having trouble in parsing a tag using java.
Goal:
My goal is to parse complete div tag with all of its contents,...