|
Well...yes..but I at the end I figured out that I did not need to create 150 variable names. An array worked fine.
Sorry for the newbie question, I am a newbie and basically I've learned not to be afraid of asking "newbie" or stupid questions. That's the way I learn....
once again I apologize f r my idiocy.
|
|
|
|
|
Dear Experts
I want to remove all the input tags from following html
<p>
<input id="00000000-0000-0000-1001-000000000000" type="button" value="Customer Job ID-JobData" />
</p>
<p>
<input id="00000000-0000-0000-1002-000000000000" type="button" value="Job Date-JobData" />
</p>
The output html should look like
<p>
</p>
<p>
</p>
I have tried a lot of using javascript and regexp but failed, Give me javascript code or RegExp to solve my problem please
Thanks in advance
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:44am.
|
|
|
|
|
|
Demanding is very rude. Show what you've done and ask for help, but don't demand anyone give you code I know the language. I've read a book. - _Madmatt
|
|
|
|
|
If you're going to make demands like this, download this[^] tool and figure it out yourself.
Really, how hard could it be to look for "<input " and then "/>" or "</input>"...
|
|
|
|
|
I am trying following regular expression, but it is not working.
private string StripTagsRegex(string source)
{
return Regex.Replace(source, @"(\<[input][^\>]+\>)", string.Empty);
}
Please give me suggestion to solve my problem
|
|
|
|
|
i want data flow diagrams for the unicode optical character reconition using neural network project
tulasi
|
|
|
|
|
That's good. I'm so pleased for you, in fact there was a bit of touching cloth there, so pleased was I."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
That's nice. People in Hell want ice water.
What are the chances we're going to supply either?
Seriously, showing up in any forum and demanding people hand over their hard work to you so you don't have to do it yourself makes you look like a steaming pile of elephant dung. If you get fired over this or fail a class, so be it. You deserve as much.
|
|
|
|
|
Hi everyone. I'm wondering about this and I can't find the answer anywhere: I know in an instance method arg_0 contains the instance the method was called on -- but what (if anything) does it contain in a static method? Would it be the type of the class the method belongs to?
(When I say arg_0 I'm of course talking about MSIL (aka CIL), the intermediate language into which C# gets compiled. Arg_0 is the implicit argument, i.e., this in an instance method. What about static methods?)
Thanks. modified on Friday, February 19, 2010 7:48 AM
|
|
|
|
|
Great, I'm an idiot. I just found it: in a static method it contains the first argument (a non-implicit argument), if any.
For example:
void instanceMethod(int intArg, float floatArg) {
}
static void staticMethod(int intArg, float floatArg) {
}
In instanceMethod :
* arg_0 = this
* arg_1 = intArg
* arg_2 = floatArg
In staticMethod :
* arg_0 = intArg
* arg_1 = floatArg
I'd delete this post, but I'll leave it up in case anyone has the same question.
Here's where I got the answer. There's a lot of useful info on Reflection.Emit.
|
|
|
|
|
Good day.
In my app have ListBox and i items draged.How to know Drag&Drop to Windows Explorer ?
My draged items size will be very big , like 4,5 GB, so i can't use MemoryStream.
Please help me.
Thanks .We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
Hello Friends,
i want to get the client browser time on server side. I am developing an application in C# and i want to display some alerts according to client machine time. So please let me know if there is any way in which i can get it on server side code.
Thanks
Sher Azam
|
|
|
|
|
Read the client time using javascript, put it in a hidden field, post the form.
|
|
|
|
|
Thanks for your reply.
can you please provide me sample code for it?
actually i try this method but when i get the hidden field on server side it came empty.
a sample code will be very helpful for me.
|
|
|
|
|
|
Hey guys, I'm trying to create a regular expression which matches text with html links in it. I want to extract both the URL and the 'clickable' text. The regular expression so far :
(<a(.)*href=("|')(?<url>(.)*)("|')(.)*>(?<text>(.)+)</a>)
Now in general, this works. When I enter a text with a html link in it :
blah blah blah <a href="/link.aspx" target="_blank">clickable text</a> blah blah
The regular expression returns one match containing <a href... ... </a> so that works fine...
However, when I enter a text that contains two links :
blah blah blah <a href="/link.aspx" target="_blank">clickable text</a> blah blah blah blah blah <a href="/link.aspx" target="_blank">clickable text</a> blah blah
The regular expression still returns one match, containing the first <a href... till the second </a> which is not the wanted result. I want the regular expression to return two matches. Can anyone help me?
Regex regx = new Regex("<a(.)*href=(\"|')(?<url>(.)*)(\"|')(.)*>(?<text>(.)+)</a>", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Compiled);
MatchCollection col = regx.Matches(Input);
|
|
|
|
|
Try this tool, Expresso[^]. It has a library of regex and testing environment that may help I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I am familiar with Expresso, which by the way returns the same result. Expresso also returns only one match containing the tag opening of the first link, untill the closure of the second link. I want two matches with both links
Thanks for the help anyway
|
|
|
|
|
I think your problem is that . is greedy. You should make it lazy with ? . (Reference[^])
This <a(.)*?href=(\"|')(?<url>(.)*?)(\"|')(.)*?>(?<text>(.)+?)</a> should work. Although it is untested.
Lazy lookup is less efficient than regular lookup so you may want to use something more appropriate like (?<url>[^'"]*) .
I have found http://www.regular-expressions.info/[^] to be a great resource.
|
|
|
|
|
Wow, works flawless! You for presedent!!
Thanks !
|
|
|
|
|
Hi everyone.
I'm creating a class through reflection and I'd like to have a static initializer like this:
class MyClass {
static MyClass() {
someMethod(typeof(MyClass));
}
}
That is, I'd like to obtain the type of MyClass and pass it to someMethod as argument. What's giving me trouble is obtaining the type of MyClass , since I'm emitting this code before the type MyClass is created: I'm defining MyClass with a TypeBuilder , but I haven't called CreateType() yet because I first need to add the static initializer. I have a hen-and-egg situation here.
Ideally what I'd like is to do something like:
class MyClass {
static MyClass() {
someMethod(this.GetType());
}
}
but of course not with this because I'm in a static member and there's no "this". So, is there something equivalent to this but that identifies the class (or type) in which the code is declared (i.e., to which class belongs the code that is being run)? Sorry if I don't make much sense, I'm having trouble expressing this clearly
Thanks!modified on Friday, February 19, 2010 8:35 AM
|
|
|
|
|
blackblizzard wrote: someMethod(this.GetType());
Try this.
someMethod(typeof(MyClass)); Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
No, sorry, the problem is I'm emitting the code with Reflection.Emit, so I can't just type "MyClass".
It works like this:
* Someone calls my class ObjectFactory with a Type they want me to extend, say "MyType".
* Using reflection, I create a subclass of MyType, called EXT_MyType, which has some extra fields and methods. I want to add a static initializer to EXT_MyType, which should look like this:
static EXT_MyType() {
someMethod(typeof(EXT_MyType));
}
But the problem is when I emit the code for this static initializer I haven't yet created the type EXT_MyType (that's what I'm doing, I'm creating its static initializer, etc), so I don't know how to emit this code. See, I'm trying to emit it like this:
ilGenerator.Emit(OpCodes.Ldtoken, typeof(EXT_MyType));
ilGenerator.Emit(OpCodes.Call, typeof(EXT_MyType).GetMethod("someMethod"));
but EXT_MyType doesn't exist yet. So I'm wondering whether there's a primitive or something I can invoke from within the static initializer that will allow me to do this instead:
static EXT_MyType() {
someMethod(getTypeOfThisClass());
}
Where getTypeOfThisClass() would be that "primitive or something...". Since this call would take place once I've created EXT_MyType there wouldn't be a problem. I just don't know whether a primitive like that exists.
If it doesn't, I'd appreciate suggestions on alternative ways of doing this.
Thanks!
|
|
|
|