正则表达式引擎库汇合

 1.总览表格

一些正则表达式库的对比
index库名编程语言说明代码示例编译指令
1Posix正则C语言是C标准库中用于编译POSIX风格的正则表达式库
 
posix-re.cgcc posix-re.c 
2PCRE库C语言提供类似Perl语言的一个正则表达式引擎库。

一般系统上对应/usr/lib64/libpcre.so这个库文件,它 是PCRE(Perl Compatible Regular Expressions)库的动态链接库文件,通常用于在Linux系统中提供对正则表达式的支持。PCRE库是由 Philip Hazel 开发的,提供了对Perl风格正则表达式的支持,包括编译、执行和处理正则表达式的功能。

test-pcre.cgcc test-pcre.c  -lpcre
3RE2C++RE2是google开源的正则表达式一厍,田Rob Pike和 Russ Cox 两位来自google的大牛用C++实现。它快速、安全,线程友好,是PCRE、PERL 和Python等回溯正则表达式引擎(backtracking regularexpression engine)的一个替代品。RE2支持Linux和绝大多数的Unix平台。

2.代码示例

2.1 posix-re.c

#include <stdio.h>
#include <regex.h>

int main() {
        regex_t regex;
        int ret;
        char str[] = "hello world";
        // 编译正则表达式
        ret = regcomp(&regex, "hello", REG_EXTENDED);
        if (ret != 0)  
        {   
                printf("Error compiling regex\n");
                return 1;
        }   
        // 执行匹配
        ret = regexec(&regex, str, 0, NULL, 0); 
        if (ret == 0) {
                printf("Match found\n");
        } else if (ret == REG_NOMATCH) {
                printf("No match found\n");
        } else {
                printf("Error executing regex\n");
        }   
        // 释放正则表达式
        regfree(&regex);

        return 0;
}

2.2 test-pcre.c

#include <stdio.h>
#include <string.h>
#include <pcre.h>

int main() {
    const char *pattern = "hello (\\w+)";
    const char *subject = "hello world";
    const int subject_length = strlen(subject);

    const char *error;
    int error_offset;
    pcre *re = pcre_compile(pattern, 0, &error, &error_offset, NULL);
    if (re == NULL) {
        printf("PCRE compilation failed at offset %d: %s\n", error_offset, error);
        return 1;
    }   

    int ovector[3];
    int rc = pcre_exec(re, NULL, subject, subject_length, 0, 0, ovector, 3); 
    if (rc < 0) {
        printf("PCRE execution failed with error code %d\n", rc);
        pcre_free(re);
        return 1;
    }   

    printf("Match found: ");
    for (int i = ovector[2]; i < ovector[3]; i++) {
        printf("%c", subject[i]);
    }   
    printf("\n");

    pcre_free(re);
    return 0;
}

3.接口说明

3.1 posix-re

       #include <sys/types.h>
       #include <regex.h>

       int regcomp(regex_t *preg, const char *regex, int cflags);

       int regexec(const regex_t *preg, const char *string, size_t nmatch,
                   regmatch_t pmatch[], int eflags);

       size_t regerror(int errcode, const regex_t *preg, char *errbuf,
                       size_t errbuf_size);

       void regfree(regex_t *preg);
DESCRIPTION
   POSIX regex compiling
       regcomp() is used to compile a regular expression into a form that is suitable for subsequent regexec() searches.

       regcomp() is supplied with preg, a pointer to a pattern buffer storage area; regex, a pointer to the null-terminated string and cflags, flags used
       to determine the type of compilation.

       All regular expression searching must be done via a compiled pattern buffer, thus regexec() must always be supplied with the  address  of  a  reg‐
       comp() initialized pattern buffer.

       cflags may be the bitwise-or of one or more of the following:

       REG_EXTENDED
              Use POSIX Extended Regular Expression syntax when interpreting regex.  If not set, POSIX Basic Regular Expression syntax is used.

       REG_ICASE
              Do not differentiate case.  Subsequent regexec() searches using this pattern buffer will be case insensitive.

       REG_NOSUB
              Do  not  report  position of matches.  The nmatch and pmatch arguments to regexec() are ignored if the pattern buffer supplied was compiled
              with this flag set.

       REG_NEWLINE
              Match-any-character operators don't match a newline.

              A nonmatching list ([^...])  not containing a newline does not match a newline.

              Match-beginning-of-line operator (^) matches the empty string immediately after a newline, regardless  of  whether  eflags,  the  execution
              flags of regexec(), contains REG_NOTBOL.

              Match-end-of-line operator ($) matches the empty string immediately before a newline, regardless of whether eflags contains REG_NOTEOL.


 POSIX regex matching
       regexec()  is used to match a null-terminated string against the precompiled pattern buffer, preg.  nmatch and pmatch are used to provide informa‐
       tion regarding the location of any matches.  eflags may be the bitwise-or of one or both of REG_NOTBOL  and  REG_NOTEOL  which  cause  changes  in
       matching behavior described below.

       REG_NOTBOL
              The match-beginning-of-line operator always fails to match (but see the compilation flag REG_NEWLINE above) This flag may be used when dif‐
              ferent portions of a string are passed to regexec() and the beginning of the string should not be interpreted as the beginning of the line.

       REG_NOTEOL
              The match-end-of-line operator always fails to match (but see the compilation flag REG_NEWLINE above)

   Byte offsets
       Unless REG_NOSUB was set for the compilation of the pattern buffer, it is possible to obtain match addressing information.  pmatch must be  dimen‐
       sioned  to  have  at  least  nmatch  elements.  These are filled in by regexec() with substring match addresses.  The offsets of the subexpression
       starting at the ith open parenthesis are stored in pmatch[i].  The entire regular expression's match addresses are  stored  in  pmatch[0].   (Note
       that to return the offsets of N subexpression matches, nmatch must be at least N+1.)  Any unused structure elements will contain the value -1.

       The regmatch_t structure which is the type of pmatch is defined in <regex.h>.

           typedef struct {
               regoff_t rm_so;
               regoff_t rm_eo;
           } regmatch_t;

       Each  rm_so  element  that is not -1 indicates the start offset of the next largest substring match within the string.  The relative rm_eo element
       indicates the end offset of the match, which is the offset of the first character after the matching text.

   POSIX error reporting
       regerror() is used to turn the error codes that can be returned by both regcomp() and regexec() into error message strings.

       regerror() is passed the error code, errcode, the pattern buffer, preg, a pointer to a character string buffer, errbuf, and the size of the string
       buffer,  errbuf_size.   It  returns  the  size  of  the  errbuf  required to contain the null-terminated error message string.  If both errbuf and
       errbuf_size are nonzero, errbuf is filled in with the first errbuf_size - 1 characters of the error message and a terminating null byte ('\0').

   POSIX pattern buffer freeing
       Supplying regfree() with a precompiled pattern buffer, preg will free the memory allocated to the pattern buffer by the  compiling  process,  reg‐
       comp().

RETURN VALUE
       regcomp() returns zero for a successful compilation or an error code for failure.

       regexec() returns zero for a successful match or REG_NOMATCH for failure.

ERRORS
       The following errors can be returned by regcomp():
      REG_BADBR
              Invalid use of back reference operator.

       REG_BADPAT
              Invalid use of pattern operators such as group or list.

       REG_BADRPT
              Invalid use of repetition operators such as using '*' as the first character.

       REG_EBRACE
              Un-matched brace interval operators.

       REG_EBRACK
              Un-matched bracket list operators.

       REG_ECOLLATE
              Invalid collating element.

       REG_ECTYPE
              Unknown character class name.

       REG_EEND
              Nonspecific error.  This is not defined by POSIX.2.

       REG_EESCAPE
              Trailing backslash.

       REG_EPAREN
              Un-matched parenthesis group operators.

       REG_ERANGE
              Invalid use of the range operator, e.g., the ending point of the range occurs prior to the starting point.

       REG_ESIZE
              Compiled regular expression requires a pattern buffer larger than 64Kb.  This is not defined by POSIX.2.

       REG_ESPACE
              The regex routines ran out of memory.

       REG_ESUBREG
              Invalid back reference to a subexpression.

3.2 pcre

3.2.1 pcre_complie-编译正则表达式

NAME
       PCRE - Perl-compatible regular expressions

SYNOPSIS

       #include <pcre.h>

       pcre *pcre_compile(const char *pattern, int options,
            const char **errptr, int *erroffset,
            const unsigned char *tableptr);

       pcre16 *pcre16_compile(PCRE_SPTR16 pattern, int options,
            const char **errptr, int *erroffset,
            const unsigned char *tableptr);

       pcre32 *pcre32_compile(PCRE_SPTR32 pattern, int options,
            const char **errptr, int *erroffset,
            const unsigned char *tableptr);

DESCRIPTION

       This function compiles a regular expression into an internal form. 
 It is the same as pcre[16|32]_compile2(), except for the absence of the 
 errorcodeptr argument. Its arguments are:
         pattern       A zero-terminated string containing the
                         regular expression to be compiled
         options       Zero or more option bits
         errptr        Where to put an error message
         erroffset     Offset in pattern where error was found
         tableptr      Pointer to character tables, or NULL to
                         use the built-in default

       The option bits are:
         PCRE_ANCHORED           Force pattern anchoring
         PCRE_AUTO_CALLOUT       Compile automatic callouts
         PCRE_BSR_ANYCRLF        \R matches only CR, LF, or CRLF
         PCRE_BSR_UNICODE        \R matches all Unicode line endings
         PCRE_CASELESS           Do caseless matching
         PCRE_DOLLAR_ENDONLY     $ not to match newline at end
         PCRE_DOTALL             . matches anything including NL
         PCRE_DUPNAMES           Allow duplicate names for subpatterns
         PCRE_EXTENDED           Ignore white space and # comments
         PCRE_EXTRA              PCRE extra features
                                   (not much use currently)
         PCRE_FIRSTLINE          Force matching to be before newline
         PCRE_JAVASCRIPT_COMPAT  JavaScript compatibility
         PCRE_MULTILINE          ^ and $ match newlines within data
         PCRE_NEWLINE_ANY        Recognize any Unicode newline sequence
         PCRE_NEWLINE_ANYCRLF    Recognize CR, LF, and CRLF as newline
                                   sequences
         PCRE_NEWLINE_CR         Set CR as the newline sequence
         PCRE_NEWLINE_CRLF       Set CRLF as the newline sequence
         PCRE_NEWLINE_LF         Set LF as the newline sequence
         PCRE_NO_AUTO_CAPTURE    Disable numbered capturing paren-
                                   theses (named ones available)
         PCRE_NO_UTF16_CHECK     Do not check the pattern for UTF-16
                                   validity (only relevant if
                                   PCRE_UTF16 is set)
         PCRE_NO_UTF32_CHECK     Do not check the pattern for UTF-32
                                   validity (only relevant if
                                   PCRE_UTF32 is set)
         PCRE_NO_UTF8_CHECK      Do not check the pattern for UTF-8
                                   validity (only relevant if
                                   PCRE_UTF8 is set)
         PCRE_UCP                Use Unicode properties for \d, \w, etc.
         PCRE_UNGREEDY           Invert greediness of quantifiers
         PCRE_UTF16              Run in pcre16_compile() UTF-16 mode
         PCRE_UTF32              Run in pcre32_compile() UTF-32 mode
         PCRE_UTF8               Run in pcre_compile() UTF-8 mode

         PCRE must be built with UTF support in order to use PCRE_UTF8/16/32 and 
PCRE_NO_UTF8/16/32_CHECK, and with UCP support if PCRE_UCP is used.

       The  yield  of the function is a pointer to a private data structure that 
contains the compiled pattern, or NULL if an error was detected. Note that compiling
regular expressions with one version of PCRE for use with a different
       version is not guaranteed to work and may cause crashes.

       There is a complete description of the PCRE native API in the pcreapi page and 
a description of the POSIX API in the pcreposix page.

3.2.2 pcre_exec-函数参数说明

 int pcre_exec(
               const pcre *code, 
               const pcre_extra *extra,
               const char *subject, 
               int length, 
               int startoffset,
               int options, 
               int *ovector, 
               int ovecsize
              );
   This function matches a compiled regular expression against a given subject string, 
using a matching algorithm that is similar to Perl's. It returns offsets to captured 
substrings. Its arguments are:

         code         Points to the compiled pattern
         extra        Points to an associated pcre[16|32]_extra structure,
                        or is NULL
         subject      Points to the subject string
         length       Length of the subject string, in bytes
         startoffset  Offset in bytes in the subject at which to
                        start matching
         options      Option bits
         ovector      Points to a vector of ints for result offsets
         ovecsize     Number of elements in the vector (a multiple of 3)
  
The options are:

         PCRE_ANCHORED          Match only at the first position
         PCRE_BSR_ANYCRLF       \R matches only CR, LF, or CRLF
         PCRE_BSR_UNICODE       \R matches all Unicode line endings
         PCRE_NEWLINE_ANY       Recognize any Unicode newline sequence
         PCRE_NEWLINE_ANYCRLF   Recognize CR, LF, & CRLF as newline sequences
         PCRE_NEWLINE_CR        Recognize CR as the only newline sequence
         PCRE_NEWLINE_CRLF      Recognize CRLF as the only newline sequence
         PCRE_NEWLINE_LF        Recognize LF as the only newline sequence
         PCRE_NOTBOL            Subject string is not the beginning of a line
         PCRE_NOTEOL            Subject string is not the end of a line
         PCRE_NOTEMPTY          An empty string is not a valid match
         PCRE_NOTEMPTY_ATSTART  An empty string at the start of the subject
                                  is not a valid match
         PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations
         PCRE_NO_UTF16_CHECK    Do not check the subject for UTF-16
                                  validity (only relevant if PCRE_UTF16
                                  was set at compile time)
         PCRE_NO_UTF32_CHECK    Do not check the subject for UTF-32
                                  validity (only relevant if PCRE_UTF32
                                  was set at compile time)
         PCRE_NO_UTF8_CHECK     Do not check the subject for UTF-8
                                  validity (only relevant if PCRE_UTF8
                                  was set at compile time)
         PCRE_PARTIAL           ) Return PCRE_ERROR_PARTIAL for a partial
         PCRE_PARTIAL_SOFT      )   match if no full matches are found
         PCRE_PARTIAL_HARD      Return PCRE_ERROR_PARTIAL for a partial match
                                  if that is found before a full match

3.2.3 pcre.h文件中的一些枚举值

这些枚举值在pcre_exec的返回值中被用到。
/* Exec-time and get/set-time error codes */

#define PCRE_ERROR_NOMATCH          (-1)
#define PCRE_ERROR_NULL             (-2)
#define PCRE_ERROR_BADOPTION        (-3)
#define PCRE_ERROR_BADMAGIC         (-4)
#define PCRE_ERROR_UNKNOWN_OPCODE   (-5)
#define PCRE_ERROR_UNKNOWN_NODE     (-5)  /* For backward compatibility */
#define PCRE_ERROR_NOMEMORY         (-6)
#define PCRE_ERROR_NOSUBSTRING      (-7)
#define PCRE_ERROR_MATCHLIMIT       (-8)
#define PCRE_ERROR_CALLOUT          (-9)  /* Never used by PCRE itself */
#define PCRE_ERROR_BADUTF8         (-10)  /* Same for 8/16/32 */
#define PCRE_ERROR_BADUTF16        (-10)  /* Same for 8/16/32 */
#define PCRE_ERROR_BADUTF32        (-10)  /* Same for 8/16/32 */
#define PCRE_ERROR_BADUTF8_OFFSET  (-11)  /* Same for 8/16 */
#define PCRE_ERROR_BADUTF16_OFFSET (-11)  /* Same for 8/16 */
#define PCRE_ERROR_PARTIAL         (-12)
#define PCRE_ERROR_BADPARTIAL      (-13)
#define PCRE_ERROR_INTERNAL        (-14)
#define PCRE_ERROR_BADCOUNT        (-15)
#define PCRE_ERROR_DFA_UITEM       (-16)
#define PCRE_ERROR_DFA_UCOND       (-17)
#define PCRE_ERROR_DFA_UMLIMIT     (-18)
#define PCRE_ERROR_DFA_WSSIZE      (-19)
#define PCRE_ERROR_DFA_RECURSE     (-20)
#define PCRE_ERROR_RECURSIONLIMIT  (-21)
#define PCRE_ERROR_NULLWSLIMIT     (-22)  /* No longer actually used */
#define PCRE_ERROR_BADNEWLINE      (-23)
#define PCRE_ERROR_BADOFFSET       (-24)
#define PCRE_ERROR_SHORTUTF8       (-25)
#define PCRE_ERROR_SHORTUTF16      (-25)  /* Same for 8/16 */
#define PCRE_ERROR_RECURSELOOP     (-26)
#define PCRE_ERROR_JIT_STACKLIMIT  (-27)
#define PCRE_ERROR_BADMODE         (-28)
#define PCRE_ERROR_BADENDIANNESS   (-29)
#define PCRE_ERROR_DFA_BADRESTART  (-30)
#define PCRE_ERROR_JIT_BADOPTION   (-31)
#define PCRE_ERROR_BADLENGTH       (-32)
#define PCRE_ERROR_UNSET           (-33)

3.2.4 pcre_exec-源码实现

源码在pcre_exec.c文件中。

3.2.5 pcre_exec-函数返回值说明

该函数的返回值是一个整数,代表了匹配的结果。具体来说,
(1)返回值大于等于 0:
如果返回值为非负数,表示成功匹配,且返回值是匹配的子串数量加1。
这表示正则表达式成功匹配目标字符串,并且返回了匹配的子串数量。
返回值为0时,表示正则表达式成功匹配了目标字符串,但没有返回任何子串,即没有捕获组。


(2)返回值小于0:
返回值是负数,表示匹配失败或发生了错误。
返回值为 -1('PCRE_ERROR_NOMATCH')时,表示正则表达式未能匹配目标字符串。
其他负数返回值表示发生了其他错误,可能是由于正则表达式本身的问题、目标字符串格式问题或者
内存分配问题等。
根据 'pcre_exec' 函数的返回值,可以判断正则表达式是否成功匹配目标字符串,以及获取匹配的
子串数量等信息。在实际使用中,可以根据返回值来进行适当的处理和错误检测。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/508934.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

读所罗门的密码笔记07_共生思想(中)

1. 在人工智能系统中建立信任 1.1. 人类的大脑容易被个人倾向、干扰因素和确认偏误所影响 1.2. 古莱说&#xff0c;然而&#xff0c;从不同的角度去思考事实、花更长时间来做决策的能力&#xff0c;可能会让人类拥有“密探”一般的智慧 1.3. 我们可以对决策进行批判性思考&a…

c语言----自定义类型---结构体(声明、重命名、对齐规则、传参、位段...详解)

目录 一、结构体类型的声明二、结构体的特殊声明三、结构体的重命名四、结构体的自引用五、结构体的内存对齐5.1对齐规则5.1.1练习 5.2为什么存在内存对齐?5.3 修改默认对齐数 六、结构体传参七、结构体实现位段7.1什么是位段7.2 位段的内存分配7.3 位段的跨平台问题7.4 位段的…

谷粒商城——通过接口幂等性防止重复提交订单

如果用户向后端服务提交多次相同订单的提交服务&#xff0c;那么后端应该只生成一条订单记录。 有一些操作天然是幂等的&#xff0c;如查询操作和删除操作等。 幂等性实现 1.token机制&#xff08;仅这个方法适用于订单的重复提交&#xff09; 后端先生成1个令牌将其记录在R…

智能停车场物联网远程监控解决方案

智能停车场物联网远程监控解决方案 智能停车场物联网远程监控解决方案是一种集成了现代物联网技术、大数据分析以及云计算等先进技术手段&#xff0c;对停车场进行全面智能化管理的综合系统。它通过实时感知、精准采集和高效传输各类停车数据&#xff0c;实现对停车场运营状态…

机器学习(四)

贝叶斯分类器与贝叶斯学习: 贝叶斯分类器:只要是一种生成式模型&#xff0c;并且使用到了贝叶斯公式 贝叶斯学习:一定在使用分布估计 贝叶斯分类器并不等于贝叶斯学习 极大似然估计: 先假设某种概率分布形式&#xff0c;再基于训练样例对参数进行估计 集成学习: 如何得到…

C#学习笔记 面试提要

冒泡 for (int m 0; m < arr.Length; m) { for (int n 0; n < arr.Length - 1 - m; n) { if (arr[n] > arr[n1]) { int temp arr[n]; arr[n] arr[n 1]; arr[n1] temp; } } } 选择 for (int m 0; m < arr.Length; m) { int index 0; for (int n 1; n < …

亿图图示如何绘制WBS分解?

什么是WBS分解&#xff1f; Wbs分解俗称工作分解结构法&#xff0c;就是把一个大项目按照原则分成多个小任务&#xff0c;再把每项小任务分解成具体的工作&#xff0c;然后把工作分到每人的工作中的一种分解方法。 如下图这里以开店KTV为例&#xff0c;项目是开店&#xff0c;小…

Unity UGUI之Text组件基础认识

Text组件用于在游戏中显示文本。 下面来细看下它的基本信息。 一、基本属性&#xff1a; 如上图所示&#xff0c;即为Text组件的一些基本属性&#xff0c;其中&#xff0c; Text&#xff1a;要显示的文本内容。Font&#xff1a;文本所使用的字体。Font Style&#xff08;字体…

基于PSO优化的CNN-LSTM-Attention的时间序列回归预测matlab仿真

目录 1.算法运行效果图预览 2.算法运行软件版本 3.部分核心程序 4.算法理论概述 4.1卷积神经网络&#xff08;CNN&#xff09;在时间序列中的应用 4.2 长短时记忆网络&#xff08;LSTM&#xff09;处理序列依赖关系 4.3 注意力机制&#xff08;Attention&#xff09; 5…

05 | Swoole 源码分析之 WebSocket 模块

首发原文链接&#xff1a;Swoole 源码分析之 WebSocket 模块 大家好&#xff0c;我是码农先森。 引言 WebSocket 是一种在单个 TCP 连接上进行全双工通信的协议。它允许客户端和服务器之间进行实时数据传输。 与传统的 HTTP 请求-响应模型不同&#xff0c;WebSocket 可以保持…

【C语言基础】:自定义类型(二) -->联合和枚举

文章目录 一、联合体1.1 联合体类型的声明1.2 联合体的特点1.3 相同成员的结构体和联合体对比1.4 联合体大小的计算1.5 联合体练习 二、枚举类型2.1 枚举类型的声明2.2 枚举的优点 书山有路勤为径&#xff0c;学海无涯苦作舟。 创作不易&#xff0c;宝子们&#xff01;如果这篇…

docker + miniconda + python 环境安装与迁移

本文主要列出从安装到安装python环境到迁移环境的整体步骤。 windows与linux之间进行测试。 一、docker 安装和测试 【linux端】 可以参考其他教程&#xff0c;不在此赘述&#xff0c;以windows端举例。 【windows端】 我的是windows10 家庭中文版&#xff0c;docker 安装和…

HWOD:字符串逆序

一、知识点 回车键的ASCII码是10 fgets()会读入回车键&#xff0c;也就是说字符串最后一个字符之后是回车键&#xff0c;再之后才是\0 字符串逆序不一定要真正的逆序&#xff0c;只需倒着从最后一个字符打印到第一个字符即可 二、题目 1、描述 将一个字符串str的内容颠倒…

问题2-前端json数组数据转换成csv文件

代码 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>将 JSON 数据导出为 CSV 文件</title> …

市场复盘总结 20240401

仅用于记录当天的市场情况&#xff0c;用于统计交易策略的适用情况&#xff0c;以便程序回测 短线核心&#xff1a;不参与任何级别的调整&#xff0c;采用龙空龙模式 一支股票 10%的时候可以操作&#xff0c; 90%的时间适合空仓等待 二进三&#xff1a; 进级率中 38% 最常用…

绝地求生:[更新周报] 4/3 不停机更新:无上新、众多物品和活动即将下架!

大家好&#xff0c;我闲游盒&#xff1b;本周三4月3号&#xff0c;绝地求生不会有停机时间&#xff0c;大家可以随便玩~ ▲本周可选地图池 亚服/东南亚服&#xff1a;艾伦格、荣都、萨诺、米拉玛、帕拉莫&#xff1b; 日服/韩服KAKAO服&#xff1a;艾伦格、泰戈、萨诺、荣都、…

Spring面试常见问题

目录 1、为什么要用Spring框架&#xff1f;2、有了spring为什么又出现了 springboot&#xff1f;3、springboot出现后为什么又出现了spring cloud&#xff1f;4、SpringBoot自动配置&#xff08;重点&#xff09;5、SpringBoot启动流程&#xff08;重点&#xff09;6、简单谈一…

香港科技大学广州|数据科学与分析学域硕博招生宣讲会—天津大学专场

时间&#xff1a;2024年4月12日&#xff08;星期五&#xff09;14:00 地点&#xff1a;天津大学北洋园校区55楼B204 报名链接&#xff1a;https://www.wjx.top/vm/Q0cKTUI.aspx# 跨学科研究领域 *数据驱动的人工智能和机器学习 *统计学习和建模 工业和商业分析 *特定行业的数…

80C51实现四种流水灯流水灯 | 自用学习笔记

单个流水灯 #include <reg51.h> #include <intrins.h> // 包含移位库函数的头文件void delay(void) // 定义延时函数 {unsigned char i, j;for(i 0; i < 200; i) // 循环延时&#xff0c;延时约50msfor(j 0; j < 125; j); }void main(void){ unsigned ch…

C++ 注册Nacos

下载源码&#xff1a; git clone GitHub - nacos-group/nacos-sdk-cpp: C client for Nacos 编译源码 cd nacos-sdk-cpp cmake . make 生成库文件 在nacos-sdk-cpp 下 注册nacos 将include 和libnacos-cli.so libnacos-cli-static.a 放入你的工程 如果Nacos服务地址:…