It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
here is my web list
mywebsite/
mywebsite/myweb.html
mywebsite/children1
mywebsite/clidrend2
mywebsite/clidrens3
mywebsite/clidrend4
mywebsite/parent1/S2
mywebsite/parent1/S3
mywebsite/parent1/S4
how do I just have
mywebsite/myweb.html
mywebsite/
and ignore the others.
here is my regex
mywebsite/|mywebsite/myweb.html
Done it :-) thanks everyone
^mywebsite\/myweb\.html|mywebsite\/$
Is this what you want as a result?
mywebsite(/m.*|/)
You could try the following, I could be more precise if you show us the regex you are actually using.
(WhateverYouAreUsing){2}
(...) is a group and {...} is a quantifier, it will take exactly two of the matches you are looking for. {1,2} will take at least one and at maximum two, in case there is only one and you still want to get a match.
Put some parentheses in your regex and escape the .:
(mywebsite/)|(mywebsite/myweb\.html)
Alternatively, for something a little more general:
(\w+/)|(\w+/\w+\.html)
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I've a little problem with a simple regex.
I'd like a regex to match this simple string (in a xml file) where wsse: could be optional and in particular something like this: < wsse:Username > (wsse is optional).
Could you help me?
Thanks in advance for your kind help!
This will match the username:
<(?:wsse:)?([^>]+)>
Edit:
And to allow for any string before the colon:
<(?:[^:]+:)?([^>]+)>
Although not the ideal solution (as you really should be parsing XML using an XML parser or XSLT), the following will work for you:
<((wsse:)?Username)>(.*)(</\1>)
It will also return 4 groups per match.
Group 3 will return the actual username from within the tags
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I need a regular expression for CLIA number. CLIA number is combination alpbh numeric without any spaces. Now i am using this expression /^[A-Za-z0-9]{10}$/ am i using correct expression?
you can use this....
/^[a-Z]{4}[0-9]{6}$/
^ this is used to beginning of the line.
$ end of the line.
a-Z this will match the both cases.
this case will match the four alpha character and six numbers. so totally 10 alphanumbers.
Based on your example, it sounds like you want the first four characters to be "CLia" followed by 6 digits? If so, use /^CLia\d{6}$/. If not, be more specific.
If your language support POSIX classes :
/^[[:alnum:]]{10}$/
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a excel file that must have this name format, where xxx is a number and yymmdd is a date. Only xxx and yymmdd change, the rest is always the same.
CDFSDDRCxxxCurryymmdd.xls
What is a regex I can use to check if it is correct??
Try with following regex:
^CDFSDDRC\d{3}Curr\d{6}\.xls$
In C# I think you can try something like this :
"CDFSDDRC(?<xxx>[0-9]+)Curr(?<yymmdd>[0-9][0-9][0|1][0-9][0-3][0-9])\.xls"
But you will have to check matches.Groups["yymmdd"].value once more to check for special cases such as CDFSDDRC123Curr321539.xls that match but contains an incorrect date.
I think the following should work.
CDFSDDRC\d[3]Curr(([0-9]{2}(0[13578]|1[02])(0[1-9]|[12][0-9]|3[01]))|([0-9]{2}(0[469]|1[1])(0[1-9]|[12][0-9]|30))|([0-9]{2}(02)(0[1-9]|1[0-9]|2[0-8]))|((((04|08|[2468][048]|[13579][26]))|00)(02)29))\.xsl
I think that you have to escape the backslashes in the C# string.
"CDFSDDRC\\d[3]Curr(([0-9]{2}(0[13578]|1[02])(0[1-9]|[12][0-9]|3[01]))|([0-9]{2}(0[469]|1[1])(0[1-9]|[12][0-9]|30))|([0-9]{2}(02)(0[1-9]|1[0-9]|2[0-8]))|((((04|08|[2468][048]|[13579][26]))|00)(02)29))\\.xsl"
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Please could you explain why given the following boost::regex pattern:
boost::regex re("/\\S+\\w");
/index.html is a match and /~index.html is not?
RegexBuddy in Perl mode finds a match in both cases.
Could you suggest a pattern that would work? Thanks!!
P.S. The \\w at the end is needed in order to ignore the punctuation on the end of an URL like /index.html..
UPD: Sorry just tried to make a simple test program and it works there. I guess the problem might be in the code that calls regex_search. I need a bit more time to find this out.
UPD2: Indeed the problem was in my code. Please vote to close the question. Sorry for not researching enough before posting.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
input: name <hui.li#xxx.ch>; hans#dhdfhgdfgh <hans.dampf#xxxx>;
Output: e1#mail.com, e2#mail.com, e3#mail.com,e#mail.com
I want to erase the stuff between: >;(?*)< But my regex isn't working.
If >;(?*)< is the Regex you tried, then the question mark is probably wrong. It has no special meaning. Try using >;(.*)< instead and see if thats what you wanted.
you should go another way. Instead of filtering the decoration you should write a regex, that matches only email addresses. Get the result as an array and join it with ", "
To find valid emails there are plenty of expressions out there. More ore less accurate. http://regexlib.com/Search.aspx?k=email