使用RegEx匹配元素ID [英] Matching Element id with RegEx

查看:68
本文介绍了使用RegEx匹配元素ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理的页面的一部分中有一组ID。它们是由Javascript创建的,看起来像''/ 2142''''/ usr018234''''/ boot23048''。我需要这样的东西...

I''ve got a set of ID''s in a section of a page I''m working on. They are created by Javascript and look like ''/2142'' ''/usr018234'' ''/boot23048''. I need something like this...

展开 | 选择 | Wrap | 行号

推荐答案

hi ...


欢迎来到TSDN ...


这里有一个例子:

hi ...

welcome to TSDN ...

here is an example:

展开 | 选择 | Wrap | 行号


谢谢gits!每次我需要引用一些东西时我都会使用这个地方(你们有一个很棒的存档),但是现在我才开始创建一个帐户。


完美地剥离了它,但如果我可能会再困扰你们,我有另一个问题。我觉得自己像一个完整的新手,我想我是,但我知道一遍又一遍地回答同样的问题是多么的烦恼。


我正试图循环通过特定表格中的表格行ID来查找匹配。

Thanks gits! I use this place everytime I need to reference something (you guys have a great archive), but only now am I making an account.

That worked perfectly to strip it, but if I could bother you guys again, I have another question. I feel like a complete newbie, and I guess I am, but I know how irritating it can be to answer the same questions over and over again.

I''m trying to cycle through table row id''s in a specific table looking for a match.

展开 | 选择 | Wrap | 行号


hi .. 。


您可以使用RegEx对象从用户想要创建的id动态创建正则表达式...我们假设它将是''test''...所以你可以使用类似下面的东西(它是一个例子你跳过:)):

hi ...

you may use the RegEx object to create a regex dynamically from the id that the user wants to create ... we assume it would be ''test'' ... so you may use something like the following (its an example to adapt by you :) ):

展开 | 选择 | Wrap | 行号


这篇关于使用RegEx匹配元素ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆