Ms7 Search
Google 搜尋 翻譯
calendar
« 十一月 2024 »
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
近期文章
文章分類
網站連結
Syndicate

« | »

javascript 用 regex 取出所要字串

2017-01-23 @ 19:10 in PHP, JavaScript, Sql

字串 abcd[0102] 想取出 0102

  1. 方法一:用 substr        var rc = "abcd[0102]".substr(5,4);
  2. 方法二:用 regex         var arr_rc = /^.*\[(\d+)\].*/.exec("abcd[0102]");        //取出符合我字串,第一個本身,第二個(),陣列從 0 開始
                                  var rc = arr_rc[1];
方法一固定從第六位取四位,0為第一位

方法二利用 partten 取出 [] 內的數字,不管前面有幾位都可以

迴響

javascript 用 regex 取出所要字串 | 豬窩

reverse image lookup phone look up reverse phone number lookup free check phone number spokeo
free cell phone directory at&t white pages

作者 cell phone carrier lookup @ 01:27, 2017-05-06

javascript 用 regex 取出所要字串 | 豬窩

people search free information white pages online
residential white pages lookup 411.com free reverse lookup
look up area code look up

作者 tail number lookup @ 01:31, 2017-05-06

豬窩

Hi my friend! I wish to say that this post is amazing, nice written and come
with almost all important infos. I'd like to look extra posts like this .

作者 https://keelycaravello.wordpress.com @ 15:33, 2017-05-19

javascript 用 regex 取出所要字串 | 豬窩

Every weekend i used to pay a quick visit this
web page, because i wish for enjoyment, since this this site conations actually fastidious funny material
too.

作者 those g @ 06:30, 2020-06-21

javascript 用 regex 取出所要字串 | 豬窩

Hi to every single one, it's genuinely a good for me to pay a visit this website, it includes precious Information.

作者 https://tinyurl.com/rsacwgxy g @ 08:02, 2020-06-22
發表迴響
 authimage