help useing regexp to extract text from a string
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ean Hendrickson
am 8 Nov. 2019
Beantwortet: Walter Roberson
am 8 Nov. 2019
I have a string that I extracted from a pdf
"↵↵↵1. Receptacles, general purpose. ↵2. Receptacles with integral GFCI. ↵3. USB Charger receptacles. ↵4. AFCI receptacles. ↵5. Twist-locking receptacles. ↵6. Isolated-ground receptacles. ↵7. Tamper-resistant receptacles. ↵8. Weather-resistant receptacles. ↵9. Pendant cord-connector devices. ↵10. Cord and plug sets. ↵11. Wall box dimmers. ↵12. Wall box dimmer/sensors. ↵13. Wall box occupancy/vacancy sensors. ↵14. Toggle Switches. ↵15. Floor service outlets. ↵16. Associated device plates. ↵↵"
How can I use the function regexp to extract all the descriptions after the numbers to put them into a 16x1 matrix. So the end product I want will be a 16x1 string that looks like
- Receptacles, general purpose.
- Receptacles with integral GFCI.
- USB Charger receptacles.
- AFCI receptacles.
- Twist-locking receptacles.
- Isolated-ground receptacles.
- Tamper-resistant receptacles.
- Weather-resistant receptacles.
- Pendant cord-connector devices.
- Cord and plug sets.
- Wall box dimmers.
- Wall box dimmer/sensors.
- Wall box occupancy/vacancy sensors.
- Toggle Switches.
- Floor service outlets.
- Associated device plates.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 8 Nov. 2019
parts = regexp(S, '^\d+.*$', 'dotexceptnewline', 'lineanchors');
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Low-Level File I/O finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!