20221002
This commit is contained in:
1 parent
d7b37d117d
commit
ed2a70896c
3 files changed
+382
-72
No files matched your search
+101
-2
@@ -57,6 +57,13 @@
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-09-30T14:14:46.100665Z",
|
||||
"iopub.status.busy": "2022-09-30T14:14:46.100139Z",
|
||||
"iopub.status.idle": "2022-09-30T14:14:46.109863Z",
|
||||
"shell.execute_reply": "2022-09-30T14:14:46.108679Z",
|
||||
"shell.execute_reply.started": "2022-09-30T14:14:46.100616Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
@@ -74,6 +81,99 @@
|
||||
"print(list1)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 38,
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-10-02T01:11:16.449789Z",
|
||||
"iopub.status.busy": "2022-10-02T01:11:16.449246Z",
|
||||
"iopub.status.idle": "2022-10-02T01:11:16.458463Z",
|
||||
"shell.execute_reply": "2022-10-02T01:11:16.457216Z",
|
||||
"shell.execute_reply.started": "2022-10-02T01:11:16.449740Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"('5', '10', '48')"
|
||||
]
|
||||
},
|
||||
"execution_count": 38,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import re\n",
|
||||
"t = '5小时10分48秒'\n",
|
||||
"m = re.match(r'(.*)小时(.*)分(.*)秒', t)\n",
|
||||
"m.groups()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 53,
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-10-02T01:20:50.471217Z",
|
||||
"iopub.status.busy": "2022-10-02T01:20:50.470675Z",
|
||||
"iopub.status.idle": "2022-10-02T01:20:50.482522Z",
|
||||
"shell.execute_reply": "2022-10-02T01:20:50.481212Z",
|
||||
"shell.execute_reply.started": "2022-10-02T01:20:50.471168Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[0, '10', '48']\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import re\n",
|
||||
"t = '10分48秒'\n",
|
||||
"list1 = []\n",
|
||||
"if '小时' in t and '分' in t:\n",
|
||||
" m = re.match(r'(.*)小时(.*)分(.*)秒', t)\n",
|
||||
" list1 = [m[1],m[2],m[3]]\n",
|
||||
"elif '小时' in t:\n",
|
||||
" m = re.match(r'(.*)小时(.*)秒', t)\n",
|
||||
" list1 = [m[1],0,m[2]]\n",
|
||||
"elif '分' in t:\n",
|
||||
" m = re.match(r'(.*)分(.*)秒', t)\n",
|
||||
" list1 = [0,m[1],m[2]]\n",
|
||||
"print(list1)\n",
|
||||
"#m.group()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-09-30T14:22:32.892529Z",
|
||||
"iopub.status.busy": "2022-09-30T14:22:32.892006Z",
|
||||
"iopub.status.idle": "2022-09-30T14:22:32.900751Z",
|
||||
"shell.execute_reply": "2022-09-30T14:22:32.898954Z",
|
||||
"shell.execute_reply.started": "2022-09-30T14:22:32.892480Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import re\n",
|
||||
"\n",
|
||||
"s = '2022-09-28-《气郁组》-视频学习详情_155229'\n",
|
||||
"m = re.findall(r'《(.+)》',s)\n",
|
||||
"print(m)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
@@ -397,7 +497,6 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true,
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
@@ -1230,7 +1329,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 23,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-06-30T01:50:36.294943Z",
|
||||
|
||||
Reference in new issue
Block a user