Tag:character

  • 5 sets of shell tips that you can use every day, but you may not know

    Time:2021-3-6

    1. Move the cursor Ctrl + A Ctrl + EMove the cursor to the front / backCtrl + H Ctrl + DDelete a word character before / afterCtrl + B Ctrl + FCursor forward / backward one characterEsc + B Esc + FCursor forward / next word 2. kill and yank Ctrl + KCut out […]

  • [longest palindrome substring of leetcode Hot 100]

    Time:2021-3-5

    The first question of new year’s brush is as follows: Give you a string s and find the longest palindrome substring in S.   Example 1: Enter: S = “bad”Output: “bab”Explanation: “ABA” is also the answer to the question.Example 2: Enter: S = “CBBD”Output: “BB”Example 3: Input: S = “a”Output: “a”Example 4: Enter: S = […]

  • Regular expressions in my work (1)

    Time:2021-3-4

    Looking at the code directly, I can probably understand the requirements I need to complete. I need to be here|The last group of sign segmentation is replaced with its corresponding Chinese representation (of course, there is a corresponding one here)key-valueDictionary). bs.replace(/([^\|]*)$/, function(key){return map[key];}); So inJavaHow to realize it? String str = “abcd|substr”; /*1. This method […]

  • Leetcode 67. Binary summation | Python

    Time:2021-3-3

    67. Binary summation Title Source: leetcode https://leetcode-cn.com/problems/add-binary subject Give you two binary strings and return their sum (in binary). The input is a non empty string and contains only the numbers 1 and 0. Example 1: Input: a = – 11 “, B = – 1” Output: “100” Example 2: Input: a = – 1010 […]

  • Remember the use of regular expression in a python web crawling

    Time:2021-3-2

    Yesterday, I helped my classmates to crawl a web page, about 400 pages. Fortunately, the content is very fixed, similar to the following: <tr class=’listTableBody’ height=”20″> <td class=’listTableBodyTD’ width=”100″ valign=”middle” align=”center”><div>(.*)</div> </td> <td class=’listTableBodyTD’ width=”100″ valign=”middle” align=”center”><div>(.*)</div> </td> <td class=’listTableBodyTD’ width=”230″ valign=”middle” align=”center”><div>(.*)</div> </td> <td class=’listTableBodyTD’ width=”230″ valign=”middle” align=”center”><div>(.*)</div> </td> <td class=’listTableBodyTD’ width=”110″ valign=”middle” align=”center”><div>(.*)</div> […]

  • Oeasy teaches you to play Linux 010211

    Time:2021-3-2

    Let’s review What did we talk about in the last part?🤔 The package tool is apt Packages can be downloaded, upgraded and deleted Aptitude for special management software package This time we download cowsay sudo apt install cowsay Cowsay said A cow is a cow Say is to say Cowsay is a cow The cow […]

  • Regular expressions that you can understand (expressed in JavaScript)

    Time:2021-2-26

    I am a front-end minion, and I often use regular expressions in my work, so I took time to learn the basics of regular expressions. Today, I will share what I have learned with you. I will first show you some small examples to lead you to gradually understand regular expressions. Then, on the basis […]

  • Grep, SED and awk: three powerful tools of Linux

    Time:2021-2-26

    1、 Grep and regular expressions grep Grep (global search regular expression (RE) and print out the line) is a powerful text search tool. It can use regular expressions to search text and print out the matching lines. option -This parameter must be used when you specify that you want to find a directory instead of […]

  • Comments for regular expression matching code blocks

    Time:2021-2-25

    There are many ways to use regular internal logic short-circuit matching We use multi branching to exclude, like if else, we don’t need to write complete conditions.Sometimes, small and wide conditions can not only match the final goal, but also add to the cake regexp = /str|regexp|lineannotaion|blockannotation|tampstring/g let tmp=”, str = ` ${tmp+’\`’+”${}”+ `${tmp}`+ /*A*/ […]

  • Regular learning

    Time:2021-2-24

    Regular learning class Character class [] An object that conforms to certain characteristics/[ABC] / means to match one of ABC The reverse class [^] is enclosed in brackets^ Example: [^ A] is to match characters that are not a Range class [A-Z] It can match any character in A-Z Predefined Class Predefined characters: \D is […]

  • Oeasy teaches you to play Linux 010212 pipe

    Time:2021-2-24

    What did we talk about in the last part? Cowsay Cows can have all kinds of expressions You can customize your eyes It can become all kinds of other small animals You can think of cowthink We also want cattle to say what it feels like to draw characters Review character drawing Download figlet and […]

  • Calculate the length of return single byte and double byte character mixed string

    Time:2021-2-21

    Single byte length of string Calculate the length of return single byte and double byte character mixed string #!/usr/bin/env python3 Tips: in generating.xls, .xlsxWhen waiting for a file, you can use this function to calculate the byte length of the cell content and adjust the column width accordingly. This work adoptsCC agreementReprint must indicate the […]