Regular expression to find the content of the quotes

First, some basic regular expression syntax, without the use of any one language, use notepad ++ to operate regular expression.

  • Regular Expressions: Regular expression operating a regular expression is a string, the regular expression uses special notation.
  • Regular expression operation on a string of mainly focused on what applications:

    1. match
    2. Cutting
    3. replace
    4. Seek
  • Predefined character (note: do not add any predefined character can only match one character before quantifier, such "12"can not be " \\d" match):

    1. . Represent any character (with a line terminator may or may not match the match)
    2. \d digital:[0-9]
    3. \D Non-numeric characters:[^0-9]
    4. \s Whitespace characters:[\t\n\xoB\f\r]
    5. \S Non-whitespace characters:[^\s]
    6. \wWord character: [a-zA-Z_0-9]that is, including az, AZ, 0-9, underscore.
  • Quantifier:

    1. X? X, once or not even once
    2. X* X, zero or more times
    3. X+ X, one or more times
    4. X{n} X, exactly n times
    5. X{n,} X, at least n times
    6. X{n,m} X, at least n times, but not more than m times
  • The scope of the word (can only match one character):

    1. [abc] a, b or c
    2. [^abc] Any characters, in addition to a, b or c
    3. [a-zA-Z] a to z or AZ, including two letters (range)
    4. [a-dm-p] a through d, or m through p
    5. Note: No matter how long the scope of the word in the content, with no quantifiers can only match one character only.
  • Regular and reverse packet matches the reference expression
    1. If the regular content needs to be multiplexed, you need to group content regular. The purpose of the group is to increase the regular reusability. Neither group number is specified, the group number from the beginning.
    2. Description packet nesting relationship: ((A)(B(C))): A total of four groups, groups are No. 1 ((A)(B(C))), No. 2 group is a (A), group 3 (B(C)), group 4 (C). \1: Reference matched to the first set of content. In this case it is easy to see the nesting relationship.
    3. \1Or $1  for content matching the first packet
      \2or $2  a content packet matches a first
      ...
      \9or $9  for content matching the first packet
    4. Under normal circumstances we match any two identical characters you can use \ 1 or $ 1 to refer such as strings, etc. "AA Am 99", and now repeat to match the characters, with the (\w)\1regular expression can match the results:"AA", "99"
    5. Description: (\w)to match any character except newline and tab, and \1is (\w)a reference, so that you can be understood as: (\w)\1is (\w)(\w), however , (\w)\1and (\w)(\w)the difference is that, (\w)(\w)on any two consecutive characters, such as Ac, MM, K9,may be, However, (\w)\1only AA, CC, 99such consecutive identical characters so you can understand, \1is (\w)an example of the reference, when (\w)matched to Athe time, \1is expressed as A, when (\w)matching 9the time, \1is expressed as 9.
  • Now with notepad ++ regular expression search content and the content in quotation marks.
    1. Now given data:
{"dev_id":C1088941,"time":2017-06-01T08:01:08,"voltage":215.67,"current":0.94,"speed":0,"status":false,
"temperature":25.3,"humdity":0.52},
{"dev_id":C1088941,"time":2017-06-01T08:11:02,"voltage":217.38,"current":0.69,"speed":0,"status":false,
"temperature":29.3,"humdity":0.48},
{"dev_id":C1088941,"time":2017-06-01T08:21:08,"voltage":211.83,"current":0.35,"speed":0,"status":false,
"temperature":31.9,"humdity":0.45},
{"dev_id":C1088941,"time":2017-06-01T08:31:02,"voltage":215.31,"current":0.40,"speed":0,"status":false,
"temperature":25.3,"humdity":0.45},
{"dev_id":C1088941,"time":2017-06-01T08:41:07,"voltage":211.72,"current":0.12,"speed":0,"status":false,
"temperature":30.4,"humdity":0.50},
{"dev_id":C1088941,"time":2017-06-01T08:51:05,"voltage":214.48,"current":0.36,"speed":0,"status":false,
"temperature":28.3,"humdity":0.46},
{"dev_id":C1088941,"time":2017-06-01T09:01:05,"voltage":217.45,"current":0.97,"speed":0,"status":false,
"temperature":32.9,"humdity":0.52},
{"dev_id":C1088941,"time":2017-06-01T09:11:01,"voltage":215.60,"current":0.83,"speed":0,"status":false,
"temperature":25.3,"humdity":0.48},
{"dev_id":C1088941,"time":2017-06-01T09:21:07,"voltage":215.98,"current":0.74,"speed":0,"status":false,
"temperature":27.2,"humdity":0.52},
{"dev_id":C1088941,"time":2017-06-01T09:31:04,"voltage":210.28,"current":0.81,"speed":0,"status":false,
"temperature":26.9,"humdity":0.48},
{"dev_id":C1088941,"time":2017-06-01T09:41:03,"voltage":216.37,"current":0.03,"speed":0,"status":false,
"temperature":32.2,"humdity":0.54},
{"dev_id":C1088941,"time":2017-06-01T09:51:06,"voltage":219.76,"current":0.03,"speed":0,"status":false,
"temperature":33.4,"humdity":0.51},
{"dev_id":C1088941,"time":2017-06-01T10:01:06,"voltage":216.27,"current":0.52,"speed":0,"status":false,
"temperature":25.3,"humdity":0.45},
{"dev_id":C1088941,"time":2017-06-01T10:11:02,"voltage":212.90,"current":0.38,"speed":0,"status":false,
"temperature":27.4,"humdity":0.47},
{"dev_id":C1088941,"time":2017-06-01T10:21:08,"voltage":216.21,"current":0.40,"speed":0,"status":false,
"temperature":33.2,"humdity":0.51},
{"dev_id":C1088941,"time":2017-06-01T10:31:03,"voltage":210.62,"current":0.48,"speed":0,"status":false,
"temperature":29.6,"humdity":0.51}"

Now put this date in the text data to find and double quotation marks, as shown:
Write pictures described here

{"dev_id":C1088941,"time":"2017-06-01T08:01:08","voltage":215.67,"current":0.94,"speed":0,"status":false,
"temperature":25.3,"humdity":0.52},
{"dev_id":C1088941,"time":"2017-06-01T08:11:02","voltage":217.38,"current":0.69,"speed":0,"status":false,
"temperature":29.3,"humdity":0.48},
{"dev_id":C1088941,"time":"2017-06-01T08:21:08","voltage":211.83,"current":0.35,"speed":0,"status":false,
"temperature":31.9,"humdity":0.45},
{"dev_id":C1088941,"time":"2017-06-01T08:31:02","voltage":215.31,"current":0.40,"speed":0,"status":false,
"temperature":25.3,"humdity":0.45},
{"dev_id":C1088941,"time":"2017-06-01T08:41:07","voltage":211.72,"current":0.12,"speed":0,"status":false,
"temperature":30.4,"humdity":0.50},
{"dev_id":C1088941,"time":"2017-06-01T08:51:05","voltage":214.48,"current":0.36,"speed":0,"status":false,
"temperature":28.3,"humdity":0.46},
{"dev_id":C1088941,"time":"2017-06-01T09:01:05","voltage":217.45,"current":0.97,"speed":0,"status":false,
"temperature":32.9,"humdity":0.52},
{"dev_id":C1088941,"time":"2017-06-01T09:11:01","voltage":215.60,"current":0.83,"speed":0,"status":false,
"temperature":25.3,"humdity":0.48},
{"dev_id":C1088941,"time":"2017-06-01T09:21:07","voltage":215.98,"current":0.74,"speed":0,"status":false,
"temperature":27.2,"humdity":0.52},
{"dev_id":C1088941,"time":"2017-06-01T09:31:04","voltage":210.28,"current":0.81,"speed":0,"status":false,
"temperature":26.9,"humdity":0.48},
{"dev_id":C1088941,"time":"2017-06-01T09:41:03","voltage":216.37,"current":0.03,"speed":0,"status":false,
"temperature":32.2,"humdity":0.54},
{"dev_id":C1088941,"time":"2017-06-01T09:51:06","voltage":219.76,"current":0.03,"speed":0,"status":false,
"temperature":33.4,"humdity":0.51},
{"dev_id":C1088941,"time":"2017-06-01T10:01:06","voltage":216.27,"current":0.52,"speed":0,"status":false,
"temperature":25.3,"humdity":0.45},
{"dev_id":C1088941,"time":"2017-06-01T10:11:02","voltage":212.90,"current":0.38,"speed":0,"status":false,
"temperature":27.4,"humdity":0.47},
{"dev_id":C1088941,"time":"2017-06-01T10:21:08","voltage":216.21,"current":0.40,"speed":0,"status":false,
"temperature":33.2,"humdity":0.51},
{"dev_id":C1088941,"time":"2017-06-01T10:31:03","voltage":210.62,"current":0.48,"speed":0,"status":false,
"temperature":29.6,"humdity":0.51}"

All such date plus the double quotes, like!

Published 14 original articles · won praise 35 · views 130 000 +

Guess you like

Origin blog.csdn.net/u014552678/article/details/73466175