【发布时间】:2018-10-02 06:52:39
【问题描述】:
我正在将一些代码转换为micropython,但我遇到了一个特定的正则表达式。
在python中我的代码是
import re
line = "0-1:24.2.1(180108205500W)(00001.290*m3)"
between_brackets = '\(.*?\)'
brackettext = re.findall(between_brackets, line)
gas_date_str = read_date_time(brackettext[0])
gas_val = read_gas(brackettext[1])
# gas_date_str and gas_val take the string between brackets
# and return a value that can later be used
micropython 只实现a limited set of re functions
如何仅使用有限的功能来实现相同的功能?
【问题讨论】:
标签: python python-3.x micropython