您的位置 首页 php

php基础知识考察点之正则表达式

php基础知识考察点之正则表达式

1.正则表达式的作用:分割,查找,匹配,替换 字符串

2.分隔符:正斜线(/),hash符(#)以及取反符号(~)。

3.通用原子:d D s S w W

834cd8fd80be2e883f5edb55143fac3.png

4.原子符

f0d067dbe0ba1d47cf39614ccafa887.png

5. 模式修正符

6796e666aa1eda636de1dc652fbeea3.png

6.后向引用

7.贪婪模式

8.正则表达式PCRE函数 prge_match(), preg_match_all(), preg_replace(), preg()_split().

解题方法方法

写出一个要匹配的字符串

自左向右的顺序使用正则表达式的原子和元字符进行拼接

最终加入修正模式

练习常见的正则表达式(手机号码,身份证,email,url等等)

139开头的手机号码

$str = '13988888888';$partten = '/^139/d{8}$/';preg_match($partten, str, $match);var_dump($match);

取出 html页面中所有img标签的sr 的值

$str = '<img id=content"" src="高清无码.jpg" alt="高清无码">';$partten = '/<img.*?src="(.*?)".*?/?>/i';preg_match($partten, $str, $match);var_dump($march);

以上就是php基础知识考察点之正则表达式的详细内容,更多请关注求知技术网其它相关文章!

文章来源:智云一二三科技

文章标题:php基础知识考察点之正则表达式

文章地址:https://www.zhihuclub.com/1962.shtml

关于作者: 智云科技

热门文章

评论已关闭

30条评论

  1. Based on the COVID 19 status of the region hospital and availability of health care resources American College of Surgeons ACS has proposed 3 different phases that a health care setup can encounter

  2. 17 In regard to alcohol use, it has been shown that breast cancer incidence goes up with increased alcohol intact

  3. Enhance has 8 capsules filled with high quality ingredients, which means you ll be getting 14 capsules per day for a full months worth

  4. Repatha evolocumab continue through surgery, administration every 2 weeks Therefore, in 2014 Pakistani government took initiative in the form of Prime Minister National Health Insurance Program

  5. A BRCA1 2 mutation, high breast density and prominent pushing margins of a tumor independently contribute to a frequent false negative mammography

  6. After clarification by centrifugation at 16000 g for 10 min, lysates were mixed with anti FLAG magnetic beads 2 mg beads per 0

  7. Since antibiotics typically cannot discriminate between the good and bad bacteria in our bodies, they often kill them both

  8. Taken together, evidence in this study showed that HOTAIR can activate the methylation of PTEN so as to suppress the expression of PTEN in AML ADM resistant cells by up regulating DNMT3b

  9. mebendazole augmentin for toddlers However, Dee Edwards, of the R and K Foundation, a crime victims group, said Prisoners are already better fed and cared for than pensioners so why should they be treated any different to the rest of society

  10. First, you should make sure not to drink water from the tap while you re in Mexico, and that includes brushing your teeth and keeping your mouth closed in the shower

  11. Now back on Tamoxifen still some side effects but Nothing compaired to the other two medications

  12. This treatment is not commonly used today due to the increased risk of endometrial carcinoma

  13. 1 sodium citrate, 0 Background Inappropriate prescribing can cause significant morbidity and mortality in geriatric patients

  14. Estradiol implants have also been shown to suppress the hypothalamic pituitary ovarian axis resulting in adequate endometrial preparation in women with retained ovarian function Ben Nun 1997 Sex differences have been reported for both endothelin and NO systems

  15. As this model excludes 0s and 1s, we re escalated these values, increasing or reducing the value 0 Advanced or serious conditions caused by GERD include the following

网站地图