在Javascript或jQuery中查找两个字符串之间的字符串

编程入门 行业动态 更新时间:2024-10-07 08:24:40
本文介绍了在Javascript或jQuery中查找两个字符串之间的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直试图在一行中的两个字符串之间得到一个字符串。我发现了许多使用正则表达式的教程,但由于我对正则表达式不太好,我无法弄清楚如何做到这一点。任何帮助将不胜感激。

I have been trying to get a string between two strings in a line. I found a lots of tutorials using regex but as i am not that good at regex, i am not being able to figure out how to do it. Any help will be appreciated.

var fullUrl = "something/File/?URL=www.wireshock/&IP=0.0.0.0&CAT=BLOG&USER=MAND\\DEFAULT\\market4080";

我需要找到一种方法来获取 http://之间的字符串。 com / File /?URL = 和& IP = ,然后返回 www.wireshock 。我不想把字符串从&分开得到中间的字符串,因为它破坏了一些网址与&其中的人物。任何帮助,将不胜感激。谢谢:)

i need to figure out a way to get the string between something/File/?URL= and &IP= and just return www.wireshock. I dont want to split the strings from "&" and get the middle string as it corrupts some urls with the & character in it. Any help would be appreciated. Thanks :)

推荐答案

fullUrl.match(/URL=(.*?)&/i)[1];

更多推荐

在Javascript或jQuery中查找两个字符串之间的字符串

本文发布于:2023-11-30 13:34:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1650166.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   两个   Javascript   jQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!