A newbie is looking for the 2 simplest regular expressions

Updated on technology 2024-05-25
3 answers
  1. Anonymous users2024-02-11

    100% correct.

    string reg1="\\w+";Username requirements can be written with letters, underscores and numbers.

    string reg2="^[.u4e00-\u9fa5]]+";The password can be any character except kanji.

  2. Anonymous users2024-02-10

    <> regular expressions.

    Matching numbers: [0-9]+$

    Pitting hole letter with non-negative integers (positive integers and 0): d+$ matches positive integers: [1-9] d*$

    Match non-positive integers (negative integers and 0): d+)|0+)) matches negative integers: -1-9] d*$

    Match integer: -d+$

    Match non-negative floating-point number (number of positive floating-point mountain rounds and 0): d+ (trembling ridge. \d+)?

    Match positive floating-point number: [1-9] d*\d*|0.\d*[1-9]\d*$

    Match non-positive floating-point numbers (negative floating-point numbers and 0): d+(.).d+)?0+(.0+)?

    Match negative floating-point number: -1-9] d*\d*|0.\d*[1-9]\d*)$

    Matching floating-point number: -d+(..)d+)?

    Match a string of 26 letters: [a-za-z]+$ match a string of 26 uppercase letters: [a-z]+$ match a string of 26 lowercase letters:

    a-z]+$ matches a string consisting of numbers and 26 letters: [a-za-z0-9]+$ matches a string consisting of numbers, 26 letters or underscores: w+$ matches url:

    a-za-z]+:w+(-w+)*w+(-w+matching mobile phone number: 1[3|.]4|5|6|7|8|9][0-9]$Match ID Number:

    d|d$ is a common regular expression.

  3. Anonymous users2024-02-09

    1. Determine the taxpayer identification number

    The taxpayer knows which nickname has or 20 digits, and judges whether their length matches.

    2. Verify your mobile phone number

    Judgment Start with 1[3456789] and then follow with 9 digits.

    3. Verify your email address

    Verified that the mailbox is in the correct format.

    4. Verify the landline

    Area code: preceded by a 0, followed by 2-3 digits: 0 d

    **Number: 7-8 digits: D

    Extension: Generally 3 digits: D

    In this way, it is connected to verify the regular table of **: 0 d)-)d)(-d))?

    If you need a country field (+86 for China), we don't need regex validation, just make a drop-down list selection (which is also how Apple's official website is designed).

    5. Verify (URL).

    Here's what needs to be verified by the protocol, just a domain name is successful.

    6. Verify the 6-15 digit password (a combination of English and numbers).

    Must be a combination of English and numbers

    7. Verify the 6-15 digit password (English and numbers, can be pure English and numbers).

    It can be in pure English, pure numbers

    8. Only 5 Chinese characters can be entered

    Only 5 kanji can be entered

    9. Extract the URL in the string

Related questions
3 answers2024-05-25

It's more convenient for you to use the regular rule for the situation here, ** it's all written for you, let's take it. >>>More

11 answers2024-05-25

Buy a crucian carp to be a little smaller, and then come to one yuan of tofu, first stir-fry the fish in oil, then add water to put the tofu, boil until the water boils, turn to low heat for half an hour, add salt out of the pot, and the delicious fish soup is ok.

11 answers2024-05-25

Transistor delay circuitry

There are many types of electronic delay circuits, and the simplest one is the transistor delay circuit, as shown in the figure below. The transistors in the picture are two 9014s, which form a composite tube to increase the magnification. >>>More

5 answers2024-05-25

Emulsion is a skin care product, which is used to protect and improve the texture; BB creams and blush lip gloss are makeup products. >>>More

7 answers2024-05-25

1. Put the pen in your hand as if you were writing. 2. Rotate your index finger and thumb naturally (you can practice a little slower and feel the sensation.) When turning, it should be fast, so that it has inertia), so that the pen turns counterclockwise. >>>More