Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed modification to regex to work in other situations
    primarykey
    data
    text
    <p>Just discovered that the structure of my file could be different and my regex only works sometimes because of this change. My regex is<br> <code>v6 = re.findall(r'(?s)----------\s*LOW VOLTAGE SUMMARY BY AREA.*?\rACTIVITY.+?',wholefile)</code></p> <p>It currently matches the following section of the file.</p> <pre><code>---------- LOW VOLTAGE SUMMARY BY AREA ---------- BUS NAME BASKV VOLT TIME AREA ZONE 12006 [AMISTAD 69.0] 0.971 1.8700 10 NEW MEXICO 121 11223 [WHITESA213.8] 0.918 1.9900 11 EL PASO 110 70044 [B.HYDROB4.16] 0.955 2.3233 70 PSCOLORADO 703 70044 [B.HYDROB4.16] 0.955 2.3233 70 PSCOLORADO 703 79086 [PAGOSA 115] 0.937 2.0333 73 WAPA R.M. 791 ACTIVITY? PDEV ENTER OUTPUT DEVICE CODE: 0 FOR NO OUTPUT 1 FOR PROGRESS WINDOW </code></pre> <p>However that section of the file sometimes is as below</p> <pre><code> ---------- LOW VOLTAGE SUMMARY BY AREA ---------- BUS NAME BASKV VOLT TIME AREA ZONE 12006 [AMISTAD 69.0] 0.742 13.2060 10 NEW MEXICO 121 11223 [WHITESA213.8] 0.916 1.8367 11 EL PASO 110 70187 [FTGARLND69.0] 0.936 19.6099 70 PSCOLORADO 710 73216 [WINDRIVR 115] 0.858 3.6100 73 WAPA R.M. 750 (VFSCAN) AT TIME = 20.0000 UP TO 100 BUSES WITH LOW FREQUENCY BELOW 59.600: X ----- BUS ------ X FREQ X ----- BUS ------ X FREQ 12063 [ROSEBUD 13.8] 59.506 </code></pre> <p>On both occasions I would like to capture just the section below:</p> <pre><code>---------- LOW VOLTAGE SUMMARY BY AREA ---------- BUS NAME BASKV VOLT TIME AREA ZONE 12006 [AMISTAD 69.0] 0.971 1.8700 10 NEW MEXICO 121 11223 [WHITESA213.8] 0.918 1.9900 11 EL PASO 110 70044 [B.HYDROB4.16] 0.955 2.3233 70 PSCOLORADO 703 70044 [B.HYDROB4.16] 0.955 2.3233 70 PSCOLORADO 703 79086 [PAGOSA 115] 0.937 2.0333 73 WAPA R.M. 791 </code></pre> <p>How can my regex return the section above regardless of which version of the file I am lookin at?</p>
    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