Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is the way to do it in VBA flavor: Replace "^[^""]*" with "".</p> <ul> <li>^ marks the start of the sentence.</li> <li>[^""]* marks anything other than a quote sign.</li> </ul> <p>UPDATE: Since in your additional comment you mentioned you wanted to grab the "From:" and the email address, but none of the junk in between or after, I figure instead of replace, extract would be better. Here is a VBA function written for Excel that will give you back all the subgroup matches (everything you put in parenthesis) and nothing else.</p> <pre><code>Function RegexExtract(ByVal text As String, _ ByVal extract_what As String) As String Application.ScreenUpdating = False Dim i As Long Dim result As String Dim allMatches As Object Dim RE As Object Set RE = CreateObject("vbscript.regexp") RE.Pattern = extract_what RE.Global = True Set allMatches = RE.Execute(text) For i = 0 To allMatches.Item(0).submatches.count - 1 result = result &amp; allMatches.Item(0).submatches.Item(i) Next RegexExtract = result Application.ScreenUpdating = True End Function </code></pre> <p>Using this code, your regex call would be: "^(.+: ).+(&lt;.+>).*"</p> <ul> <li>^ denotes start of sentence</li> <li>(.+: ) denotes first match group. .+ is one or more characters, followed by : and a space</li> <li>.+ denotes one or more characters</li> <li>(&lt;.+>) denotes second match group. &lt; is &lt;, then .+ for one or more characters, then the final ></li> <li><p>.* denotes zero or more</p> <p>characters.</p></li> </ul> <p>So in excel you'd use (assuming cell is A1):</p> <pre><code>=RegexExtract(A1, "^(.+: ).+(&lt;.+&gt;).*") </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload