Use RegEx to match URL [closed]

Pattern p = new Pattern(“https://mon.contoso.com/mon/call.py?fn=edit&num=(\d+)”) Matcher m = p.matcher(inputEmail); return m.matches() ? m.group(1) : “”; This returns num if it is numeric, otherwise you might want to use \w instead of \d. If you want the whole URL, remove the group() parameter.

PowerShell expression

It takes the contents of a file ‘InputName’, runs it through a regular expression and outputs it to the file ‘OutputName’. The expression takes something in front of a comma, plus the comma itself and concatenates it with something that’s behind a double backslash, some text, a backslash, some text and another backslash. So it … Read more

How does the () and [] come into play with regex?

the r(ege)+x expression will match the letter r followed by one or more sets of the string of letters ege followed by the letter x Possible matches would be “regex”, “regeegex”, “regeegeegex”, and so on. The expression r[ege]+x will match the letter r followed by one or more of any of the letters in the … Read more

regex pattern to find example url from string [closed]

As Marty says, it all depends on which language you are using. You could do it in JavaScript, like so: var myString = “i have a example link:- https://www.google.co.in/search?q=web+service+urls&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=sb&gfe_rd=cr&ei=ex5iU-6CLMeW8QezvoCgAg i need a regex to extact that full url from text string. thanks!”; var myRegexp = /(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/ var match = myRegexp.exec(myString); alert(match[0]); Here’s a demo I … Read more