python regex to get all text until a (, and get text inside brackets
I need help with 2 regex. get all text until a open bracket. e.g. this is so cool (234) => 'this is so cool' get the text inside the brackets, so the # '234' ...
I need help with 2 regex. get all text until a open bracket. e.g. this is so cool (234) => 'this is so cool' get the text inside the brackets, so the # '234' ...
I'm using PHP. I'm trying to get a Regex pattern to match everything between value=" and " i.e. Line 1 Line 2,...,to Line 4. value="Line 1 Line 2 Line 3 Line 4" I've tried /.*?/ but it doesn't seem to work. I'd appreciate some help. Thanks. P.S. I'd just like to add, in response to some comments, that all strings between the first ...
I need to extract the quantity and unit from strings like this 1 tbsp 1tbsp 300ml 300 ml 10grams 10 g The quantities will always be numbers, then there may or may not be a space then the unit. They may be 15 - 20 different units which can come from a list that we define (perhaps an array) The solution can be in either javascript or...
I have some text encoded in ISO-8859-1 which I then extract some data from using Regex. The problem is that the strings I get from the matcher object is in the wrong format, scrambling chars like "ÅÄÖ". How do I stop the regex library from scrambling my chars? Edit: Here's some code: private HttpResponse sendGetRequest(String url) th...
Hi, I have an input textbox that runs a js function on the keyup event to match for a valid string (domain name pattern match, the regex was found on here). I wrote the if statements to test whether the input is a valid pattern first and then more than 3 characters long. Apparently, my ifs don't work like I wanted them to. When th...
Anyone knows the Regexp for AS3 to get the domain name from URL? E.g: "http://www.google.com/translate" will get "http://www.google.com" ...
<?php $test = "<!--my comment goes here--> Hello World "; echo preg_replace('/\<.*?\>/','',$test); ?> the code above echos hello world i want it to echo my comment goes here ...
Hi, I need some RegExp help for a Flex 3 website. I'm trying to find this: px;'</img> And replace it with: px;'></img> I've tried: var tester: String = " blah height: 0px;'<\img>blah"; var pattern1:RegExp = /px;'<\/img>/g; tester = tester.replace(pattern1, "px;'></img>"); I think that the problem ...
Hi all, I am wondering , how would i match the words "SAN JOSE" in a string "I love SAN JOSE but JOSE does not like it " so in essence i do not want the the word Jose to be matched but SAN JOSE should be matched together. any ideas . thanks ...
I'm looking for a way to obfuscate mailtos in the source code of a web site. I'd like to go from this: href="mailto:[email protected]" To this: href="" onmouseover="this.href='mai'+'lto:'+'pre'+'sid'+'ent'+'@wh'+'ite'+'hou'+'se.'+'gov'"</code> I'm probably going to go with a PHP solution instead, like this (that way I only h...
I am having a hard time figuring out the earliest version of perl where non-capturing parentheses are supported in regex patterns? Can I take this feature for granted for all versions of Perl5? ...
Consider the following regular expressions: 7+ (7)+ Does anyone that is very familiar with regular expression theory in Mathematics agree that the two regular expressions are semantically the same? ...
Given an input string, I would like to get the output from this in the specified format: filename;path. For the input string: /vob/TEST/.@@/main/ch_vobsweb/1/VOBSWeb/main/ch_vobsweb/4/VobsWebUI/main/ch_vobsweb/2/VaultWeb/main/ch_vobsweb/2/func.js I expect this output string: func.js;VOBSWeb/VosWebUI/VaultWeb/func.js The filename ...
Hi, I need to extract the number from the following simple string: base:873 where the "base:" portion is optional, i.e., it may/may not exist in the string. How am I supposed to extract the number from the above string using RegExp? P.S.: It's an unfortunate to see such a big difference between other Regular Expression implementatio...
I'm writing myself a simple screen scraping application to play around with the HTMLAgilityPack library, and after getting it to work on several different types of HtmlNodes, I figured I'd get fancy and throw in a Regex for Email addresses as well. The only problem is that the application never finds any matches, or maybe it is but not r...
Hello, Consider the code below, why it is not working? <?php $str = " <h4> title </h4> "; $result = preg_match_all ('/<h4>([\d\D])<\/h4>/mi', $str, $matches); var_dump($matches); ...
I am looking for a regex pattern that ensures the user puts in a single lower case word with only letters of the alphabet. Basically they are picking a subdomain. Thanks in advance ...
Hi! At the moment, I am coding an Google Chrome extension (in Javascript) which interfaces with GMail. The extension needs to know the unique email identifier that is present at the end of every GMail URL. Eg. https://mail.google.com/mail/#inbox/11a4ac0cg2bc3330 https://mail.google.com/mail/#label/Archived+Emails/11a4c8b472b...
I'm having problem with matching non-HTML tags in text mainly, because tags starts with < and ends with > but not < and >. So instead <ref>xx</ref> i have <ref>xxx</ref>. What I need to do is remove all such tags including their content. The problem is that some tags may have attributes. I found nice answer here but st...
Possible Duplicate: What regular expression can never match? I'm looking for a regular expression that will not match any string. Example: suppose I have the following Java code public boolean checkString(String lineInput, String regex) { final Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE); final Matc...