help useing regexp to extract text from a string
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Ean Hendrickson
el 8 de Nov. de 2019
Respondida: Walter Roberson
el 8 de Nov. de 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 comentarios
Respuesta aceptada
Walter Roberson
el 8 de Nov. de 2019
parts = regexp(S, '^\d+.*$', 'dotexceptnewline', 'lineanchors');
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Low-Level File I/O en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!