Tag:regular expression

  • In depth analysis of regular expressions and wildcards

    Time:2021-10-11

    1. Special symbols ”      What you see is what you get“”      Special symbols are parsed and run“      == $ () run the command inside first and leave the result>      Redirection symbol         First empty the contents of the file, and then append the last part of the file>>     Append redirection […]

  • [JS] code that limits the number of text bytes with JavaScript regular expressions

    Time:2021-10-8

    When doing the project, write a JS for everyone. The problem of limiting the number of words in text is often used in practical development; The main problem is the restriction on Chinese. The following code solves the verification problem of limiting the number of bytes; As long as the code is saved in a […]

  • DW (Dreamweaver) regular expression function list

    Time:2021-10-7

    Just used Teleport   Pro pulled a whole station to the local, and all hyperlinks were forced to add a tppabs = “…” newly installed system and Dreamweaver   8. Play the replacement function of DW. Search range: search the whole current local site: source code search: \ btppabs = “H [^”] * “replace: (empty) […]

  • Java regular expression foundation, example learning materials collection original

    Time:2021-10-6

    For Java pattern class and matcher class, please refer to the website http://www.ibm.com/developerworks/cn/java/l-regp/part2/ Special characters in regular expressions:  \\ Backslash  \ T interval (‘\ u0009’)  \ N line feed (‘\ u000a’)  \ R enter (‘\ u000d’)  \ The d number is equivalent to [0-9]  \ D non numeric equivalent to [^ 0-9]  \ S blank […]

  • Java regular expression foundation, example learning materials collection original

    Time:2021-10-6

    For Java pattern class and matcher class, please refer to the website http://www.ibm.com/developerworks/cn/java/l-regp/part2/ Special characters in regular expressions:  \\ Backslash  \ T interval (‘\ u0009’)  \ N line feed (‘\ u000a’)  \ R enter (‘\ u000d’)  \ The d number is equivalent to [0-9]  \ D non numeric equivalent to [^ 0-9]  \ S blank […]

  • Java regular expression foundation, example learning materials collection original

    Time:2021-10-5

    For Java pattern class and matcher class, please refer to the website http://www.ibm.com/developerworks/cn/java/l-regp/part2/ Special characters in regular expressions:  \\ Backslash  \ T interval (‘\ u0009’)  \ N line feed (‘\ u000a’)  \ R enter (‘\ u000d’)  \ The d number is equivalent to [0-9]  \ D non numeric equivalent to [^ 0-9]  \ S blank […]

  • Common regular expressions and comments – necessary for learning regular expressions

    Time:2021-10-2

    Regular expressions matching Chinese characters:   [\u4e00-\u9fa5]Comment: matching Chinese is really a headache. It’s easy to do with this expressionMatching double byte characters (including Chinese characters): [^ \ X00 – \ XFF]Comment: can be used to calculate the length of a string (a double byte character length meter 2, ASCII character meter 1)Regular expressions that […]

  • Regular expressions commonly used in ASP to replace strings

    Time:2021-10-1

    Remove HTML tag regular < \ / * [^ < >] * >Function LoseHtml(ContentStr)     Dim ClsTempLoseStr,RegEx         ClsTempLoseStr = Cstr(ContentStr)     Set RegEx = New RegExp         RegEx.Pattern = “<\/*[^<>]*>”         RegEx.IgnoreCase = True         RegEx.Global = True     ClsTempLoseStr = RegEx.Replace(ClsTempLoseStr,””)     Set RegEx = Nothing     LoseHtml = ClsTempLoseStr End function Remove class from web pageFunction LoseClassTag(ContentStr)     Dim ClsTempLoseStr,RegEx         ClsTempLoseStr = Cstr(ContentStr)     Set RegEx = New RegExp         RegEx.Pattern = “(class=){1,}(“”|\’){0,1}\S+(“”|\’|>|\s){0,1}”         RegEx.IgnoreCase = True         RegEx.Global = True     ClsTempLoseStr = RegEx.Replace(ClsTempLoseStr,””)     LoseClassTag = ClsTempLoseStr     Set RegEx = Nothing End Function Function LoseScriptTag(ContentStr)     Dim ClsTempLoseStr,RegEx         ClsTempLoseStr = Cstr(ContentStr)     Set RegEx = New RegExp         RegEx.Pattern = “(<script){1,}[^<>]*>[^\0]*(<\/script>){1,}”         RegEx.IgnoreCase = True         RegEx.Global = True     ClsTempLoseStr = RegEx.Replace(ClsTempLoseStr,””)     LoseScriptTag = ClsTempLoseStr     Set RegEx = Nothing End Function Function LoseIFrameTag(ContentStr)     Dim ClsTempLoseStr,RegEx         ClsTempLoseStr = Cstr(ContentStr)     Set RegEx = New RegExp         RegEx.Pattern = “(<iframe){1,}[^<>]*>[^\0]*(<\/iframe>){1,}”         RegEx.IgnoreCase = True […]

  • JavaScript regular expressions use detailed parameters

    Time:2021-9-29

    Regular expression constructor:   new   RegExp(“pattern”[,”flags”]);  Parameter Description:  pattern  —  A regular expression text  flags  —  If present, it will be the following values:  g:   Global matching  i:   ignore case  gi:   Above combination   In the constructor, some special characters need to be converted (add “\” before the special characters). Special […]

  • The most commonly used PHP regular expressions are collected and sorted

    Time:2021-9-27

    PHP code $str = preg_replace(“/(<a.*?>)(.*?)(<\/a>)/”, ‘\1<span>\2</span>\3’, $str); Three sub modes are used (one for each parenthesis). The first is the link start label, the second is the link text, and the third is the</a> Then \ 1, \ 2 and \ 3 in the second parameter represent these three parts. It is not easy to […]

  • Four applications of regular expressions in web page processing

    Time:2021-9-26

    Regular expression provides an efficient and convenient method for string pattern matching. Almost all high-level languages provide support for regular expressions or an off the shelf code base for invocation. Taking the common processing tasks in ASP environment as an example, this paper introduces the application skills of regular expression. 1、 Verify the format of […]

  • ASP regular expression matches the number $$

    Time:2021-9-25

         Copy codeThe code is as follows: Dim strOk,strNo      strOk = “12312321$12312312312$12312321$”      strNo = “12312321$12312312312$12312321$sdfsd”      Function RegExpTest(patrn, strng)           Dim   regEx,   match,   matches    ‘  Create variables.           Set   regEx  =  New   RegExp    ‘  Create a canonical expression.           regEx.Pattern  =  patrn    ‘  Set the mode.           regEx.IgnoreCase  =  True    ‘  Sets whether letters are case sensitive.           […]