Use regular expressions on Python to extract the time from a mixed time and Japanese string.
Only the time part of the time is extracted, and the whole thing doesn't go well.
Python 3.8.2 (on pyenv)
I am a beginner in both regular expressions and Stack Overflow, so please let me know if there are any deficiencies.Thank you for your cooperation.python regular-expression
The reason why the example in the questionnaire doesn't work as expected is that the group you are capturing using parentheses only has the first two digits.
For example, you can write roughly as follows:
At this rate, a tuple will be printed, but if the list is better, use
This is a non-captured version of normal parentheses.It matches a regular expression enclosed in parentheses, but the partial string that this group matches cannot be retrieved after the match has been performed or referenced later in the pattern.
© 2022 OneMinuteCode. All rights reserved.