zoukankan      html  css  js  c++  java
  • 第十八节

    一 、js正则

    test - 判断是否符合规定的正则

    exec - 获取匹配的数据

    test

    rep = /d+/;
    /d+/
    rep.te
    undefined
    rep.test("dgdf343dgffddsf332")
    true
    rep.test("dsfssgd")
    false
    获取字符串中的数字
    rep = /^d+$/
    /^d+$/
    rep
    /^d+$/
    rep.test("123")
    true
    rep.test("123df")
    false
    开头结尾之匹配数字

     exec

    rep = /d+/
    /d+/
    str = "dsfsd_ss235_324dfgd"
    "dsfsd_ss235_324dfgd"
    rep.exec(str)
    ["235", index: 8, input: "dsfsd_ss235_324dfgd"]
    获取字符串的的数字
    text = "Java is more fun than JavaScript and JavaBeans"
    "Java is more fun than JavaScript and JavaBeans"
    var pattern = /Javaw*/
    undefined
    pattern.exec(text)
    ["Java", index: 0, input: "Java is more fun than JavaScript and JavaBeans"]
    
    # ""可以识别字符串的的空格,以字符串为分割;"w"可以识别所有,不限数据类型;"d"只识别数字。
    获取一整句字符串中的指定字符
    text = "JavaScript is more fun than Java and JavaBeans"
    "JavaScript is more fun than Java and JavaBeans"
    var pattern = /Java(w*)/
    undefined
    pattern.exec(text)
    (2) ["JavaScript", "Script", index: 0, input: "JavaScript is more fun than Java and JavaBeans"]
    
    # 匹配Java开头的JavaScript,同时又对Script做了分离,以字符串列表的行书返回。
    整体取出再分离

     

    正则表达式

    /..../  用语定义正则表达式

    /.../g  匹配整行

    /.../i  不区分大小写

    /.../m  多行匹配

    var pattern = /Javaw*/gm 整行匹配

    # 单行匹配
    
    var pattern = /Javaw*/g
    undefined
    pattern.exec(text)
    ["JavaScript", index: 0, input: "JavaScript is more fun than Java and JavaBeans"]
    pattern.exec(text)
    ["Java", index: 28, input: "JavaScript is more fun than Java and JavaBeans"]
    pattern.exec(text)
    ["JavaBeans", index: 37, input: "JavaScript is more fun than Java and JavaBeans"]
    pattern.exec(text)
    
    # 多行匹配
    
    var pattern = /^Java(w*)/g
    undefined
    pattern.exec(text)
    (2) ["JavaScript", "Script", index: 0, input: "JavaScript is more fun than ↵Java and JavaBeans"]
    pattern.exec(text)
    null
    var pattern = /^Java(w*)/gm
    undefined
    pattern.exec(text)
    (2) ["JavaScript", "Script", index: 0, input: "JavaScript is more fun than ↵Java and JavaBeans"]
    pattern.exec(text)
    (2) ["Java", "", index: 29, input: "JavaScript is more fun than ↵Java and JavaBeans"]
    pattern.exec(text)
    null
    View Code

    二、组件

    BootStrap

      - css

      - js

    easyUI

      - css

      - js

    jQueryUI

      - css

      - js

    1.js验证

     # 创建django项目

    django-admin startproject mysite

    # mysite目录结构

    mysite

      - mysite    # 对整个程序进行配置

        - settings   # 配置文件 # 注销csrf;添加templates路径;在文件尾配置static路径,STATICFILES_DIRS;

        - url     # url对应关系

        - wsgi    # 寻租wsgi规范,uwsgi + nginx

          wsgi遵循很多规则,这些规则的本质是帮助django创建socket

      - manager.py  #管理django程序:

              - python manage.py

              - python manage.py startapp xx

              # python自己的orm,管理自己的数据库。生成自己的类

              - python manage.py makemigrations

              - python manage.py migrate

     # 在django项目中创建app

    python manager.py startapp crm

  • 相关阅读:
    Kotlin入门(20)几种常见的对话框
    Kotlin入门(19)Android的基础布局
    Kotlin入门(18)利用单例对象获取时间
    Kotlin入门(17)等式判断的情况
    Kotlin入门(16)容器的遍历方式
    Kotlin入门(15)独门秘笈之特殊类
    Android Studio Gradle被墙bug总结
    unity常用的坐标系转换
    欧拉角与万向节死锁
    Unity导出Gradle工程给Android Studio使用
  • 原文地址:https://www.cnblogs.com/ttyypjt/p/8279208.html
Copyright © 2011-2022 走看看