问题描述
我正在使用正则表达式从字符串中获取特定格式.
下面是字符串.
javascript:__ doPostBack(''ctl00 $ MainContent $ TreeView1'',''sC:* | * \\ C:* | ** | *备份文件* | * \\ C:* | ** | *备份文件* | ** | *解决方案1 | *'')
从上面的字符串中,我只想获取 C:* | ** | *备份文件* | ** | * Solution1 * | * 部分.这个怎么做.我已经尝试过了.
mystr.match(/\ w {1} [:] [*] [|] [*] [*] [|] [*] [az AZ 0-9 \ s * |] */)
通过这种方法,我只得到 C:* | ** | * Backup Files * | * 部分.
请帮助
Hi,
I am using a regular expression for getting a specific format from a string.
Below is the string.
javascript:__doPostBack(''ctl00$MainContent$TreeView1'',''sC:*|*\\C:*|**|*Backup Files*|*\\C:*|**|*Backup Files*|**|*Solution1*|*'')
From the above string i want to fetch Only C:*|**|*Backup Files*|**|*Solution1*|* part. How to do this. I have tried this in my way.
mystr.match(/\w{1}[:][*][|][*][*][|][*][a-z A-Z 0-9\s*|]*/)
Through this method i am getting only the C:*|**|*Backup Files*|* part.
Please Help
推荐答案
这篇关于匹配字符串的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!