fork download
  1. import re
  2.  
  3. captions = [
  4. "Figure 1: Path of Reading Materials from the Web to a Student.",
  5. "FIGURE 1 - Travel CP-net",
  6. "Figure 1 Interpretation as abduction, the big picture.",
  7. "Fig. 1. The feature vector components",
  8. "Fig 1: IMAGACT Log-in Page",
  9. "FIG 1 ; The effect of descriptive and interpretive information, and Inclination o f Fit",
  10. "FIGURE 1 – The system diagram"
  11. ]
  12.  
  13. for caption in captions:
  14. caption = re.sub(r'\bfig\.?(?:ure)? 1[^\S\r\n]*[:.;–-]?[^\S\r\n]', '', caption, flags=re.IGNORECASE)
  15. print(caption)
Success #stdin #stdout 0.02s 9540KB
stdin
Standard input is empty
stdout
Path of Reading Materials from the Web to a Student.
Travel CP-net
Interpretation as abduction, the big picture.
The feature vector components
IMAGACT Log-in Page
The effect of descriptive and interpretive information, and Inclination o f Fit
The system diagram