Loading...
String/tag left side. e.g. <a>
String/tag right side. e.g. </a>
Count: 0
Allow regex in string/tag fields.   Case insensitive.   Strip left/right string/tag.   Extract across line breaks.  

Tool: Extract text between two strings, tags, characters, etc.

Purpose: Extract text/content between two strings, tags, characters, commas, brackets, parentheses, quotes, etc.
Instructions: Load working-text, enter left side of string/tag into "String/tag left side" field, enter right side of string/tag into "String/tag right" field and click "Extract text between" button.
Example:

Extract url addresses from hyperlink href attribute.

Working-text is:

<a href="http://example.com/page1.html">Page 1</a>
<a href="http://example.com/page2.html">Page 2</a>
<a href="http://example.com/page3.html">Page 3</a>


Enter href=" into "String/tag left side" field, " into "String/tag right side" field, check "Strip left/right string/tag" checkbox and click "Extract text between..." button to produce:

http://example.com/page1.html
http://example.com/page2.html
http://example.com/page3.html




Extract link text from hyperlinks containing differing text within <a> tag using regex.

Working-text is:

<a href="http://example.com/page1.html">Page 1</a>
<a href="http://example.com/page2.html">Page 2</a>
<a href="http://example.com/page3.html">Page 3</a>


Since the <a> tag has differing text within it's href attribute it will not be seen as the same tag within this tool's function unless we use a regex phrase telling the tool to overlook the differing text. Given the tag "<a href="http://example.com/page1.html">" replace the differing text between "<a" and ">" with regex .*? producing <a.*?> telling tool to overlook the differing text. Note: When regex enabled special characters []{}().*+?^=!:$\| must be escaped with a single backslash to operate as literal characters. Do not use capturing parentheses around the regex phrase because it will upset tool's function skewing results. See "Find and replace text" tool for more reading about regex usage.

To perform function, check "Allow regex in string/tag fields" checkbox, enter <a.*?> into "String/tag left side" field, </a> into "String/tag right side" field and click "Extract text between..." button to produce:

Page 1
Page 2
Page 3




Enter literal find text to escape special characters.
Skip pipe bar.