I asked this question earlier, but it got a negative vote, so I'm rewording it.
I have:
<cfset myExpression = "X">
#REFind(myExpression,myString)#
I need to change myExpression so that it returns a value other than zero if there is NOT an X in myString, and a 0 if there is an X in myString.
...
I need to parse and split C and C++ functions into the main components (return type, function name/class and method, parameters, etc).
I'm working from either headers or a list where the signatures take the form:
public: void __thiscall myClass::method(int, class myOtherClass * )
I have the following regex, which works for most fu...
Hello All
I am "attempting" to scrape a web page that has the following structures within the page:
<p class="row">
<span>stuff here</span>
<a href="http://www.host.tld/file.html">Descriptive Link Text</a>
<div>Link Description Here</div>
</p>
I am scraping the webpage using curl:
<?php
$handle = curl_init();
...
Hi, I had a quick question regarding RegEx...
I have a string that looks something like the following:
"This was written by <p id="auth">John Doe</p> today!"
What I want to do (with javascript) is basically extract out the 'John Doe' from any tag with the ID of "auth".
Could anyone shed some light? I'm sorry to ask.
Full story:
I ...
I'm trying to create a regex for apache that will ignore certain strings, but will use anything else. Ive tried many different methods however i just can't seem to get it correct.
for example
i want it to ignore
ignore.mysite.com
but anything else i want it to use
*.mysite.com
...
given:
var regexp = new RegExp("<~~include(.*?)~~>", "g");
What's the easist way in javascript to assign a variable to whatever's matched by .*?
I can do this, but it's a little ugly:
myString.match(regexp).replace("<~~include", "").replace("~~>", "");
...
I'm writing some autosuggest functionality which suggests page names that relate to the terms entered in the search box on our website.
For example typing in "rubbish" would suggest "Rubbish & Recycling", "Rubbish Collection Centres" etc.
I am running into a problem that some of our page names include macrons - specifically the macron ...
I want to find out if there could ever be conflicts between two known regular expressions, in order to allow the user to construct a list of mutually exclusive regular expressions.
For example, we know that the regular expressions below are quite different but they both match xy50:
'^xy1\d'
'[^\d]\d2$'
Is it possible to determine, us...
I am trying to parse an HTML file ( non strict one) using JavaScript
my output should be the same HTML file, but I need to process the internal content of any <script></script> tag. I have a method processScript(script) that does that..
I can assume that there will be no <script/> tags.
I have a pretty clear idea how to it using just ...
I have the following string and regex:
var string = "Dear [to name], [your name] has decided to share this [link]";
var patt = /\[+[A-Za-z0-9]+\]/;
I want to be able to change each of the bracketed variables with dynamic input. How would I use match() or replace() to target the 1st, 2nd and 3rd occurrences of this regex?
EDIT: At th...
I have a table in the db with one column containing a URL like http://site.com/users/*/profile
I am given a URL (like http://site.com/users/234/profile) and want to select all the rows in the db that match the url (in this case * is a wildcard).
I was thinking of using Regex to do this, by replacing the * with regex for any character....
I'm trying to find the positions of all occurrences of a string in another string, case-insensitive.
For example, given the string:
I learned to play the Ukulele in Lebanon.
and the search string le, I want to obtain the array:
[2, 25, 27, 33]
Both strings will be variables - i.e., I can't hard-code their values.
I figured that th...
var foo = "blaa";
var regex = /foo/i;
results in /foo/i instead of /blaa/i.
...
Let's say I have these two strings: "5/15/1983" and "1983.05.15". Assume that all characters in the string will be numeric, except a "separator" character that can appear anywhere in the string. There will be only one separator character; all instances of any given non-numeric character in the string will be identical.
How can I use reg...
Okay, this is quite an interesting challenge I have got myself into.
My RegEx takes as input lines like the following:
147.63.23.156/159
94.182.23.55/56
134.56.33.11/12
I need it to output a regular expression that matches the range represented. Let me explain.
For example, if the RegEx receives 147.63.23.156/159, then it needs to ...
Hello,
gcc 4.4.4 c89
Does anyone know of any good online tutorials using regex in c.
I have to do a lot of regex, which I haven't done before.
If the tutorials or books could be related to sscanf would be even better.
Many thanks,
...
Hi,
I want to get contents of a URL and display only the links present on that page.
Please help. Thanks
...
I need to do a preg_replace on all of the PHP tags in a string, as well as any characters sitting between the PHP tags.
Eg, if the file contents was:
Hey there!
<?php some_stuff() ?>
Woohoo!
All that should be left is:
Hey there!
Woohoo!
Here's my code:
$file_contents = file_get_contents('somefilename.php');
$regex = '#([<?php](....
I have a string:
strArray= "-------9---------------";
I want to find 9 from the string. The string may be like this:
strArray= "---4-5-5-7-9---------------";
Now I want to find out only the digits from the string. I need the values 9,4, or such things and ignore the '-' . I tried the following:
strArray= strignId.split("-");
bu...
I have a list like
List<string> TempList = new List<string> { "[66,X,X]", "[67,X,2]", "[x,x,x]" };
I need to add data to the dictionary from the above list
Dictionary<int, int> Dict = new Dictionary<int, int>();
so the Dict should contain
Key --> 66 value --> 67
i need to take 66(first value) from first string([66,X,X]) and 67(f...