Regular Expression - urgently required
How do i write a REGEX for matching a date???
Please reply urgently
why not just use the java.text.DateFormat and let it figure it out?
%
Similar Messages
-
Regular expressions URGENT !!!
i am using the gnu.regexp package for regular expression matching can any body tell me how do i get the (regular expression)subexpression index that the string matched to without iterating
detailed problem desc:
package :gnu.regexp
regular expression : lots of regulat expression combined with "|"
method : getall matches
requirment: need to get the (regular expression's)sub expression index that the current string matched from REmatch or some other class without iteration or another call to getall matches
note: if there is no solution can it be done using java.util.regexp or jregex ( if so i need the equivalent of getall matches)
thanks in advace to all java gurusWhy you don't use groups?
In java.util.regex you can access the content of a group with "String group(int index)". Or did I missunderstand the meening of your "subexpression index" ?
Regards,
Finn -
Regular Expression help required
{color:#000000}Hi....
I am having a product table in oracle with products like CZS20T and CZSS30T and so on....
But for printing on the invoice we need only the product name without the micron thickness like CZS and CZSS{color}{color:#000000}
I tried regular expression with....."select regexp_substr('CZSS20T','([[:digit:]]{2})') from dual"
{color}
and the result was "20"*...*
But I cant figure out how to use regular expression to get only the product name.
Maybe there is another way without using Regular exp...
Please help....regexp_substr (prod, '[[:alpha:]]*')and an example:
SQL> with x as
2 ( select 'CZS20T' prod from dual union all
3 select 'CZSS30T' from dual union all
4 select 'A10CSD' from dual
5 )
6 select prod
7 , regexp_substr (prod, '[[:alpha:]]*')
8 from x
9 ;
PROD REGEXP_SUBSTR(PROD,'[[:ALPHA
CZS20T CZS
CZSS30T CZSS
A10CSD A
SQL> Edited by: Alex Nuijten on Jan 27, 2009 8:52 AM -
WebTest - VS2013 - Extract Regular Expression - Required=False
I have an "Extract Regular Expression" that may or may not be able to extract a value. I set the property value of Required to False. The next block checks for the existence of that Context Parameter. If the Context Parameter is there, it does
some work, if the Context Parameter is not there, it skips the condition.
When I run my WebTest, it tells me that it passes the extraction rule but it never created the Context Parameter so the condition is skipped.
If I set Required=True, everything works as expected.
I remembered that there was a defect in VS2010 with the Required=False, so I added this Extraction Plug-In
[DisplayName("Extract Regular Expression Not Required")]
[Description("Extract text matching a regex and add it to the test context. If no match is found, do not fail webtest. This gets around a VSTS bug where 'Required' property of the Extract Regular Expression rule is not honored.")]
public class ExtractRegularExpressionNotRequired : ExtractRegularExpression
public override void Extract(object sender, ExtractionEventArgs e)
base.Extract(sender, e);
e.Success = true;
That too passes the regular expression but fails to create the Context Parameter.By setting the Required parameter to False, I am expecting that a Context Parameter does not get created if the regular expression is not found and that is does get created if the regular expression is found.
So when I run my test, it tells me that the regular expression was found but my Context Parameter was not created.
When I created this webtest in VS2010, I found that there was a bug with the Extract Regular Expression when the Required property was False. This
thread showed the code for a custom Extraction rule to fix the problem. When I run this webtest in VS2013, both the built-in Extract Regular Expression and the custom Extract Regular Expression Not Required are not creating the Context Parameter if the
regex is found.
Try this yourself:
Create a webtest
Add "Extract Regular Expression"
Set the Regular expression to . (this will match any one character)
Set the Requiredto False
Set the Context Parameter Name to TEST
Run the webtest
Although the result from the extraction rule will be Passed, there is no Context Parameter TEST created.
If you create the custom Extract Regular Expression Not Required plugin, the same problem occurs. -
Regular Expression. Select Statement. Carriage Return
Oracle 9i
Using SQLPLUS
I've read about regular expression and need some translation/explanation.
I have a large table containing a varchar2 (free text) column. Users may have inserted carriage returns when they entered the data. I need to locate rows that contain carriage returns, select and display them. Later I'll need to update those rows to replace the carriage returns with a space.
Can you assist with syntax. I believe use of a regular expression is required.
Thanksfor single characters like <CR> TRANSLATE() Doh. Never post at the end of a long day.
As the other posters have pointed out, one-for-one single character substitution is normally done with REPLACE(), although TRANSLATE() also works. The more normal role for TRANSLATE() is situations where you want to substitute multiple characters, e.g.
SQL> update <your table> set <your column> = replace (<your column> , chr(13)||chr(10), ' ');This substitutes a space for a carriage return and line feed combination.
Cheers, APC -
Requirements gateway & regular expressions
I'm trying to create a regular expression that will match a Requirement ID type in a MS Word document using Requirements Gateway.
Our syntax for a Requirement ID is as follows:
'* shall [::requirement id] *'
An example would be
'The system shall [::requirement1] self destruct after 1 minute of use.'
I'm using the following RE.
shall[ \t]*\[[ \t]*(.*):.+)\]
I've been able to get it to match 'most' of Requirement ID's ,but a few aren't caught...most noteably those Requirement ID's that run past the end of the
line.
When 'shall' is on one line and '[::requirement1]' is on the next, the Requirement ID isn't matched.
Are there any limitations to the RE engine that Requirements Gateway uses?
If not, any help with the RE would be MUCH appreciated.
thanks
PatAllen,
Thanks for the advice. Unfortunately it didn't help
Again, our requirements are identified by a 'shall' followed by a tag in brackets.
Ie The unit shall [<optional source>::requirement id] be expensive.
The RE, "shall\[(.*):.+)\]" doesn't always work. (Sorry for the embedded emoticon)
Most of the time it identifies the tag but says
Requirement ' : XYZ' can't be covered.
Error: Requirement defined several times
Other times is combines two tags into one.
I'm attaching the modifed type and the doc thats causing the problems.
Thanks for your continued help,
Pat -
Requirement to update a column by using Regular Expression
Hi All,
I have a requirement to update a column which is having values like below code.
based on the conditinos I need to update from ‘E’ to ‘Z’. Few positions I need to update and remaining positions I need leave as it is.
How I can achive this requirement by using regular expression regexp_replace.
Actual value --> 'AEAAAEAA EE AA EE AA EE EEEAA AA AA '
After update --> 'AZAAAZAA EE AA EE AA EE EEEAA AA AA 'below is my requirement. I am adding the conditions dynamically as per the conditions. I dont know the position of the E. If 'E' is in any position I need to update with 'Z' if that 'E' satisfy the condition.
I dont want to update all the E's to Z's.
I want to update specific E's which satisfy the condition.
IF l_kwhhilow >= 1 THEN
l_where := l_where||' SUBSTR(OVERRIDEFIELD,1,1) = ''E'' OR ';
l_exp := l_exp||'Z';
ELSE
l_exp := l_exp||'\1';
END IF;
IF l_kwhilow >= 1 THEN
l_where := l_where||' SUBSTR(OVERRIDEFIELD,2,1) = ''E'' OR ';
l_exp := l_exp||'Z';
ELSE
l_exp := l_exp||'\2';
END IF;
IF l_kvahilow >= 1 THEN
l_where := l_where||' SUBSTR(OVERRIDEFIELD,3,1) = ''E'' OR ';
l_exp := l_exp||'Z';
ELSE
l_exp := l_exp||'\3';
END IF;
IF l_kvarhilow >= 1 THEN
l_where := l_where||' SUBSTR(OVERRIDEFIELD,4,1) = ''E'' OR ';
l_exp := l_exp||'Z';
ELSE
l_exp := l_exp||'\4';
END IF;
IF l_todkwh1hilow >= 1 THEN
l_where := l_where||' SUBSTR(OVERRIDEFIELD,5,1) = ''E'' OR ';
l_exp := l_exp||'Z';
ELSE
l_exp := l_exp||'\5';
END IF;
IF l_todkwh2hilow >= 1 THEN
l_where := l_where||' SUBSTR(OVERRIDEFIELD,6,1) = ''E'' OR ';
l_exp := l_exp||'Z';
ELSE
l_exp := l_exp||'\6';
END IF;
l_exp := ''''||l_exp||'''';
l_exp1 := '\1\2\3\4'||l_exp1;
IF l_todkw1hilow >= 1 THEN
l_where := l_where||' SUBSTR(OVERRIDEFIELD,11,1) = ''E'' OR ';
l_exp1 := l_exp1||'Z';
ELSE
l_exp1 := l_exp1||'\5';
END IF;
IF l_todkw2hilow = 1 THEN
l_where := l_where||' SUBSTR(OVERRIDEFIELD,12,1) = ''E'' OR ';
l_exp1 := l_exp1||'Z';
ELSE
l_exp1 := l_exp1||'\6';
END IF;
l_exp1 := ''''||l_exp1||'''';
IF i give 10 in the regexp_replace it is not working.
SET OVERRIDEFIELD = REGEXP_REPLACE(SUBSTR(overridefield,1,6), ''(.)(.)(.)(.)(.)(.)'','||l_exp||')'||
' ||REGEXP_REPLACE(SUBSTR(overridefield,7,6), ''(.)(.)(.)(.)(.)(.)'','||l_exp1||')'||
' ||SUBSTR(overridefield,13)'|| -
NIRG LabVIEW regular expression for covering multiple requirements
The Word document type in NI Requirements Gateway allows for comma separating the requirements in a Reference / coverage statement. I would like to do the same within my LabVIEW code, but the type does not have the same Sub regular expression field available. Is there any way to have a LabVIEW regular expression find coverage statements such as the following:
[Covers: REQ-5, REQ-9, REQ-15]
currently within LabVIEW comments I have to have 3 separate [Covers: REQ-5] type statementscdweiss,
I'm very interested to know if you have any other feedback on NI Requirements Gateway. I'd also be curious to know what products are you're using with it and how extensive your requirements are.
Feel free to email me directly at [email protected]
Cheers,
Eli
Message Edited by Elijah K on 01-19-2010 11:40 PM
Elijah Kerry
Senior Product Manager, LabVIEW
Follow my Software Engineering for LabVIEW Blog -
Urgent!!! Problem in regular expression for matching braces
Hi,
For the example below, can I write a regular expression to store getting key, value pairs.
example: ((abc def) (ghi jkl) (a ((b c) (d e))) (mno pqr) (a ((abc def))))
in the above example
abc is key & def is value
ghi is key & jkl is value
a is key & ((b c) (d e)) is value
and so on.
can anybody pls help me in resolving this problem using regular expressions...
Thanks in advance"((key1 value1) (key2 value2) (key3 ((key4 value4)
(key5 value5))) (key6 value6) (key7 ((key8 value8)
(key9 value9))))"
I want to write a regular expression in java to parse
the above string and store the result in hash table
as below
key1 value1
key2 value2
key3 ((key4 value4) (key5 value5))
key4 value4
key5 value5
key6 value6
key7 ((key8 value8) (key9 value9))
key8 value8
key9 value9
please let me know, if it is not possible with
regular expressions the effective way of solving itYes, it is possible with a recursive regular expression.
Unfortunately Java does not provide a recursive regular expression construct.
$_ = "((key1 value1) (key2 value2) (key3 ((key4 value4) (key5 value5))) (key6 value6) (key7 ((key8 value8) (key9 value9))))";
my $paren;
$paren = qr/
[^()]+ # Not parens
|
(??{ $paren }) # Another balanced group (not interpolated yet)
/x;
my $r = qr/^(.*?)\((\w+?) (\w+?|(??{$paren}))\)\s*(.*?)$/;
while ($_) {
match()
# operates on $_
sub match {
my @v;
@v = m/$r/;
if (defined $v[3]) {
$_ = $v[2];
while (/\(/) {
match();
print "\"",$v[1],"\" \"",$v[2],"\"";
$_ = $v[0].$v[3];
else { $_ = ""; }
C:\usr\schodtt\src\java\forum\n00b\regex>perl recurse.pl
"key1" "value1"
"key2" "value2"
"key4" "value4"
"key5" "value5"
"key3" "((key4 value4) (key5 value5))"
"key6" "value6"
"key8" "value8"
"key9" "value9"
"key7" "((key8 value8) (key9 value9))"
C:\usr\schodtt\src\java\forum\n00b\regex> -
Urgent help regarding Java regular expressions.
hello everyone,
I am trying to parse a html file which contains
dyn.Img("http://www.boston.com/news/nation/articles/2007/06/21/bill_clinton_takes_bigger_campaign_role&h=306&w=410&sz=13&hl=en&start=43","","QFo9lqKeMR7uzM:","http://cache.boston.com/resize/bonzai-fba/AP_Photo/2007/06/21/1182410228_1931/410w.jpg","125","93","\x3cb\x3eBill Clinton\x3c/b\x3e takes bigger campaign \x3cb\x3e...\x3c/b\x3e","","","410 x 306 - 13k","jpg","www.boston.com","","","http://tbn0.google.com/images","1")
the given above function many times. I have to fetch the whole functions into an array. So i have to write a regular expression which recognises the whole above string.
Can anyone please help me.
Thank you,
chaitanyawell if this is all you want
http://cache.boston.com/resize/bonzai-fba/AP_Photo/2007/06/21/1182410228_1931/410w.jpg
You can always substring it like chuck said
***BUT all the images would have to be .jpg for this to work***
back = we.indexOf(".jpg");
int x = 0;
while (back < web.lastIndexOf(".jpg"))
back = web.indexOf("http",back+1);
picture[x] = web.substring(front, back);
x++;
front = back;
} Might not be the best code but it worked with a website i had to parse
Message was edited by:
mark07 -
Regular expressions its URGENT !!!
i have a long string of regular expressions seperated by "|" and i need to know which regular expression the particular string matched how can i find that and can i do it using java .util.regex
thanks in advanceConsider to use "capturing groups" or a better solution should be to split this long regular expression with alternations in small ones that will cause considerable reduction in backtracking. Also in this way will be easier to find what regular expression matches the target string.
Regards. -
URGENT !!! need regular expression
Hi ,
I need a regular expression for a text field
What if we left the 3 character limit on alphanumeric characters (a-z/A-Z) and remove the limit for numeric characters only (0-9)?
Thing is if user enters alphanumeric values then there should be limit of 3 characters for the text filed.
if user enter numeric values then there be no limit .
i think i have given a clear explanation regarding my question....
any replies are appreciated..
thanks
bharathi..Try the following in the change event:
r=/^[a-z]{1,3}$|^\d+$/i;
if (!r.test(xfa.event.newText))
xfa.event.change="";
Kyle -
Regular expression not giving the required output.
Hi , I have msgs that look like this :
dear john smith you Bought 500 shares of Nile Cotton Ginning at 14.9 L.E On 21/01/10
Im using the Regular expression to get 4 substrings of this msg
1-Bought|Sold
2-Quantity of shares (ex: 500)
3-Name of the stock (ex:Nile Cotton Ginning)
4-price (ex:14.9)
Here is my code , but the output returns the whole msg back :
select SMSID,SMSNO,CUSTOMERACCOUNTID,SENDDATE,ENTRYDATE,
regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at (.*)','\1')),'(watheeqa)') buy_sell
regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at (.*)','\2')),'(watheeqa)') amount ,
regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at (.*)','\3')),'(watheeqa)') company ,
regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at ([0-9]*\.[0-9]*|[0-9][^A-Z][^a-z]) .*','\4')),'(watheeqa)') price
from SMSOUTMSG@bimsic s
where trunc(SENDDATE) = trunc(sysdate) -1
and exists (select 1 from PHONEDETAIL@bimsic p
where s.CUSTOMERACCOUNTID = p.CUSTOMERACCOUNTID
and SMSFLAG = 1);Thanks.It does check it out
with t
as
select 'dear john smith you Bought 500 shares of Nile Cotton Ginning at 14.9 L.E On 21/01/10' smstext from dual
select
regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at (.*)','\1')),'(watheeqa)') buy_sell,
regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at (.*)','\2')),'(watheeqa)') amount ,
regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at (.*)','\3')),'(watheeqa)') company ,
regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at ([0-9]*\.[0-9]*|[0-9][^A-Z][^a-z]) .*','\4')),'(watheeqa)') price
from t -
Required regular expression code
HI All,
i have date like this
select 'A COM' TEST from dual
union all
select 'B LAP' from dual
union all
select 'A LAP COM' from dual
union all
select 'C COM' from dual
union all
select 'A MON-COM' from dual
union all
select 'A COM LAP MON' from dual;
Example 1)when i am filtering data like
select * from table where test like or regulare expression 'A COM LAP MON' ..
it should display above All contain COM LAP MON All datas.
2)select * from table where test like or regulare expression 'A LAP COM' ..
it should display LAP AND COM contain data..
please give me query for this...
Edited by: anbarasan on Jun 20, 2012 6:52 AManbarasan wrote:
Hi Kartick..what u did't not get in my question..plese let me knowAn Unmatchable Feat achieved!!!
*<font color="red">Total Posts: 186*
Total Questions: 66 (66 unresolved)</font>
What astonishes me more is, 186 posts on this forum and you still are Ignorant of how you must ask a question. Moreover, you ask people what they did not understand?
Do you not think its time for you to Learn how to post a question from the link posted by Karthick_ARP????
I think I read a similar question from you today itself.
Re: Need sql query
Regards,
P.
Edited by: PurveshK on Jun 20, 2012 8:55 PM -
Regular Expression Required for Checksum variable
I am wanting to create a regular expression that extracts a variable checksum value (cs=) which is unique to a given server response string.
The issue I am having is that a simple regex being name="cs" value="(.+?)" just does not work because there are 18 different checksum values being returned per session id/server response.
So a simple regex just picks up any "cs" value and I guess gets confused since there are 18 different ones contained within the server response (all user related)
What i need is a regex to use say this value from the server response (JONHONEYMAN%40YAHOO.COM) or any other unique value which is contained within the string response from the server then extract the cs (Checksum) value from that string and make it variable :)
Here is the server response string:-
"fp=220:1200:2977638312763704:: NO::P1200_EMAIL_ADDRESS,P1200_ORGANISATION_NAME,P1200_UCRN,P1200_ORG_ID,P1200_CALLING_PAGE:JONHONEYMAN%40YAHOO.COM%2C john%20Honeyman%2C260%2C220%2C1190&cs=336788D01EC6E80B1877B3EE982E8B2D8" >Select</td></tr
can anyone help?
ThanksYou need an XML Parser.
Maybe you are looking for
-
I am using Mac OS 10.10 with FireFox 30.0.2 as my browser. I was making calls OK on Goggle Voice through my G-Mail account. when I ran out of credit. I loaded additional credit and tried to resume calling. However, I kept get getting the following er
-
How to save a file as an 8-bit .png in Illustrator?
Hello to all AI masters...I have a task here to save as a file as an 8-bit .png file in Illustrator? Can anybody, somebody help me on this?
-
Hi there; OC4J 10g stand alone and also tomcat 5.0x both of them without any apparently reason freeze; and just return back when i press Ctrl + C; Does any one has experience some thing like that ? Marcos Ortega Brazil
-
Wrong assignment field (ZUORN) running MR08
Hi all, On SAP R/3 4.6b we run transaction MR01 with unplanned delivery costs. As we have some price differences, the FI document has a line with the right price diff. G/L account. This G/L account has its sort key field (ZUAWA) filled with code '013
-
Add a leader to an automatic right tab?
I often want a right tab at the very edge of my text boxes. I know the shortcut for this is Shift tab. BUT... I'd like it to also have a leader... the little dots that go from the text on the left to the percentage on the right. If I use the above sh