用python提取Y\n\nPV\nRMS\n\n325.81 [nm]\n37.23 [nm]\n\nPage里面的数字
可以使用正则表达式来提取数字。以下是一个示例:
```python
import re
text = "Y
PV
RMS
325.81 [nm]
37.23 [nm]"
pattern = r'\d+\.\d+|\d+'
result = re.findall(pattern, text)
print(result)
```
输出结果为:
```
['325.81', '37.23']
```
```python
import re
text = "Y
PV
RMS
325.81 [nm]
37.23 [nm]"
pattern = r'\d+\.\d+|\d+'
result = re.findall(pattern, text)
print(result)
```
输出结果为:
```
['325.81', '37.23']
```
上一篇:通报表扬教育工作者推荐报告
下一篇:我现在睡不着应该怎么做