Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Consider the following powershell example of a universal regex. </p> <p><code>.{53}(.{18})</code></p> <h1>Example</h1> <pre><code> $Matches = @() $String = '528 LOGON 39690 SECURITY LAPTOP 8481 USER AB11 SUCCESSFUL AUDIT BBB908AFB 06/20/12 09:11:43PM 528 LOGON 39692 SECURITY LAPTOP 8495 USER AB11 LOGON COMPLETE BBB908AFB 06/20/12 09:12:12PM 528 LOGOFF 39699 SECURITY DESKTOP 4476 USER ABEQ FINAL FAILED AUDITAADAFCC01 06/20/12 09:55:49PM 528 LOGON 39690 SECURITY LAPTOP 8481 USER AB11 REMEBER TO VOTE BBB908AFB 06/20/12 09:11:43PM' Write-Host start with write-host $String Write-Host Write-Host found ([regex]'.{53}(.{18})').matches($String) | foreach { write-host "key at $($_.Groups[1].Index) = '$($_.Groups[1].Value)'" } # next match </code></pre> <h1>Yields</h1> <pre><code>start with 528 LOGON 39690 SECURITY LAPTOP 8481 USER AB11 SUCCESSFUL AUDIT BBB908AFB 06/20/12 09:11:43PM 528 LOGON 39692 SECURITY LAPTOP 8495 USER AB11 LOGON COMPLETE BBB908AFB 06/20/12 09:12:12PM 528 LOGOFF 39699 SECURITY DESKTOP 4476 USER ABEQ FINAL FAILED AUDITAADAFCC01 06/20/12 09:55:49PM 528 LOGON 39690 SECURITY LAPTOP 8481 USER AB11 REMEBER TO VOTE BBB908AFB 06/20/12 09:11:43PM found key at 53 = 'SUCCESSFUL AUDIT ' key at 159 = 'LOGON COMPLETE ' key at 265 = 'FINAL FAILED AUDIT' key at 367 = 'REMEBER TO VOTE ' </code></pre> <h1>Summary</h1> <ul> <li><code>.{53}</code> skips over the first 53 characters (note the first position in the string is zero)</li> <li><code>(.{18})</code> finds and returns the 18 character wide field</li> </ul>
    singulars
    1. This table or related slice is empty.
    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.
    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