Regular Expression Numeric characters only
Hi All,
I'm trying to select just the numeric characters only. However, this regexpression returns data that also has a - in it or alpha characters, such as 58-69-30-008 NWSE. I don't want this.
I just want rows with ONLY numeric data.
WHERE servloc like '%[0-9]%'Thanks for your help,
John
LPS wrote:
try this
where regexp_like(servloc,'[0-9]');The above will return any servloc that has at least one digit. OP asked for "just the numeric characters only". Correct regexp_like would be:
where regexp_like(servloc,'^[0-9]+$');Or:
where regexp_like(servloc,'^\d+$');SY.
Similar Messages
-
Field validation regular expression to accept only numbers
Hello.
I would like to have a field validation regular expression to accept only numbers - no characters. The list of pre-packaged regular expressions that are included with ApEx does not contain this and I am not a very good regular expression writer. Can anyone help?
Thanks!
BorisUnder the Regular Expression validation all you need to have is:
^[[:digit:]]$For the email address it just depends how detailed you want it:
^((?>[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+\x20*|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*"\x20*)*(?<angle><))?((?!\.)(?>\.?[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+)+|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*")@(((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]{2,}|\[(((?(?<!\[)\.)(25[0-5]|2[0-4]\d|[01]?\d?\d)){4}|[a-zA-Z\d\-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\\\[\]]|\\[\x01-\x7f])+)\])(?(angle)>)$or...
[\w-]+@([\w-]+\.)+[\w-]+Hope these help
Edited by: MikesHotRod on Sep 3, 2008 12:40 PM -
Regular Expression - Invalid characters
I have a varchar2(10) field that I need to query out records that contain any character NOT in the following list of characters.
1. alpha (any case)
2. numeric
3. space
4. &
5. - (hypen)
6. *
7. . (period)
8. ' (single quote)
9. (
10. )
11. , (comma)
12. #
13. /
Example:
When run against the below data it would only select the record with the % in it.
a8*-
1234
a8#kd
u%oO9
ThanksI get the following error message when I run the example above. When I remove the initial hypen (e.g. where regexp_like(field,'[^a-zA-Z0-9 &*.''(),#/]+');) it runs but I get all rows in the result set. Is this a know Oracle bug --- database is version 10.1.0.5.0?
Error starting at line 1 in command:
with t as(
select 'a8*-' field from dual union all
select '1234' from dual union all
select 'a8#kd' from dual union all
select 'u%9' from dual)
select * from t
where regexp_like(field,'[^-a-zA-Z0-9 &*.''(),#/]+')
Error report:
SQL Error: ORA-12728: invalid range in regular expression
12728. 00000 - "invalid range in regular expression"
*Cause: An invalid range was found in the regular expression.
*Action: Ensure a valid range is being used. -
Regular expression - escape characters
Hi. Is there an escape character for "?", "[", "]", "{", "}" for regular expression? I tried to do the following: "[^[]?{}]*" (the string cannot contain a question mark, left or right bracket, or left or right curly brace). However, I get an error stating unexpected character.
thanks,
Paul.Hi. Is there an escape character for "?", "[", "]",
"{", "}" for regular expression? I tried to do the
following: "[^[]?{}]*" (the string cannot contain a
question mark, left or right bracket, or left or right
curly brace). However, I get an error stating
unexpected character.
You should only have to escape the characters that cause a problem in the character class, rather than everything so the following should work.
"[^\\[\\]?{}]*" -
Validation for regular expressions special characters in java
Hi,
I need to validate an user name field to an application while creating that. It has to contain only alpha numerics. can you give me the regular expression and also how to implement that.
thanks,
VJDo your own work. Look up the documentation on Pattern and make an attempt at validating a String yourself. Then worry about implementing a GUI on top of that.
-
Regular expressions and characters as č, �, ť ...
Hi. I have this problem with regular expressions. The next piece of code is work only with string without diacritics. If I use as pattern character with diacritic the matcher is not find any occurence of a character. The code:
String pat = "č"; // "a"
String text = "naj čalamada"
Pattern pattern = Pattern.compile(pat, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(text);
while (matcher.find()) { }If I uncomment character 'a' its occurence will be founded but occurence of 'č' is not found. :(
Can you tell me what is wrong ??
If I use flag Pattern.CASE_INSENSITIVE | Pattern.CANON_EQ nothing will be changed.
Thanks for all replays.The file encoding is same as system encoding and it is utf-8.
How can I specify encoding as an inout parameter when I compile it?
Piece of code or concrete funcions help me more... -
How to use special characters in regular expression
HI all, I am new to regular expression.
Can any one please tell me the regular expression for characters which are used in regular expression like " [({. tetc.Is there any particular expression to prefix before using these charactersExpression:
< td .*? bgcolor = \" ( [^ \" ] +) \" \\s* .*? > ( .+? ) </td>
It will search for expression starting with <td ,
.*? means any characters zero or more than one,
then it will find bgcolor = , then literal \"... \(any char) is that specific char
[ ^ \" ] any character but not literal \",this means there has to be something between ".... " if empty then wont match ,+ is 1 or more times
Then again literal \ " , after that \\s* means zero or more num of spaces,
then again , .*? means any characters zero or more than one,
it will search for literal > , again any chars . * ?
Finally </td> will be searched.....!!
So all expressions having this particular structure will be
matched.
Output :
<td align="left" valign="top" bgcolor="ffffff" width="177">bla bla bla</td> -
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 -
Namburi,
When you said you used the Reg Exp tool, did you use it only as
preconfigured by the iMT migrate application wizard?
Because the default configuration of the regular expression tool will only
target the files in your ND project directories. If you wish to target
classes outside of the normal directory scope, you have to either modify the
"Source Directory" property OR create another instance of the regular
expression tool. See the "Tool" menu in the iMT to create additional tool
instances which can each be configured to target different sets of files
using different sets of rules.
Usually, I utilize 3 different sets of rules files on a given migration:
spider2jato.xml
these are the generic conversion rules (but includes the optimized rules for
ViewBean and Model based code, i.e. these rules do not utilize the
RequestManager since it is not needed for code running inside the ViewBean
or Model classes)
I run these rules against all files.
See the file download section of this forum for periodic updates to these
rules.
nonProjectFileRules.xml
these include rules that add the necessary
RequestManager.getRequestContext(). etc prefixes to many of the common
calls.
I run these rules against user module and any other classes that do not are
not ModuleServlet, ContainerView, or Model classes.
appXRules.xml
these rules include application specific changes that I discover while
working on the project. A common thing here is changing import statements
(since the migration tool moves ND project code into different jato
packaging structure, you sometime need to adjust imports in non-project
classes that previously imported ND project specific packages)
So you see, you are not limited to one set of rules at all. Just be careful
to keep track of your backups (the regexp tool provides several options in
its Expert Properties related to back up strategies).
----- Original Message -----
From: <vnamboori@y...>
Sent: Wednesday, August 08, 2001 6:08 AM
Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
forget about the regular expression potential
Thanks Matt, Mike, Todd
This is a great input for our migration. Though we used the existing
Regular Expression Mapping tool, we did not change this to meet our
own needs as mentioned by Mike.
We would certainly incorporate this to ease our migration.
Namburi
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
All--
Great response. By the way, the Regular Expression Tool uses thePerl5 RE
syntax as implemented by Apache OROMatcher. If you're doing lotsof these
sorts of migration changes manually, you should definitely buy theO'Reilly
book "Mastering Regular Expressions" and generate some rules toautomate the
conversion. Although they are definitely confusing at first,regular
expressions are fairly easy to understand with some documentation,and are
superbly effective at tackling this kind of migration task.
Todd
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@S...>
Sent: Tuesday, August 07, 2001 5:20 PM
Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
forget about the regular expression potential
Also, (and Matt's document may mention this)
Please bear in mind that this statement is not totally correct:
Since the migration tool does not do much of conversion for
these
utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
the translation tool, and the regular expression tool, and severalother
smaller tools (like the jar and compilation tools). It is correctto state
that the extraction and translation tools only significantlyconvert the
primary ND project objects (the pages, the data objects, and theproject
classes). The extraction and translation tools do minimumtranslation of the
User Module objects (i.e. they repackage the user module classes inthe new
jato module packages). It is correct that for all other utilityclasses
which are not formally part of the ND project, the extraction and
translation tools do not perform any migration.
However, the regular expression tool can "migrate" any arbitrary
file
(utility classes etc) to the degree that the regular expressionrules
correlate to the code present in the arbitrary file. So first andforemost,
if you have alot of spider code in your non-project classes youshould
consider using the regular expression tool and if warranted adding
additional rules to reduce the amount of manual adjustments thatneed to be
made. I can stress this enough. We can even help you write theregular
expression rules if you simply identify the code pattern you wish to
convert. Just because there is not already a regular expressionrule to
match your need does not mean it can't be written. We have notnearly
exhausted the possibilities.
For example if you say, we need to convert
CSpider.getDataObject("X");
To
RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
rule:
<!--getPage to getViewBean-->
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getViewBean($1ViewBean.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
Following this example a getDataObject to getModel would look
like this:
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getModel($1Model.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
In fact, one migration developer already wrote that rule andsubmitted it
for inclusion in the basic set. I will post another upgrade to thebasic
regular expression rule set, look for a "file uploaded" posting.Also,
please consider contributing any additional generic rules that youhave
written for inclusion in the basic set.
Please not, that in some cases (Utility classes in particular)
the rule
application may be more effective as TWO sequention rules ratherthan one
monolithic rule. Again using the example above, it will convert
CSpider.getDataObject("Foo");
To
getModel(FooModel.class);
Now that is the most effective conversion for that code if that
code is in
a page or data object class file. But if that code is in a Utilityclass you
really want:
>
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
So to go from
getModel(FooModel.class);
To
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
You would apply a second rule AND you would ONLY run this rule
against
your utility classes so that you would not otherwise affect yourViewBean
and Model classes which are completely fine with the simplegetModel call.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getModel\(]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getModel\(]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
A similer rule can be applied to getSession and other CSpider APIcalls.
For instance here is the rule for converting getSession calls toleverage
the RequestManager.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getSession().]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
----- Original Message -----
From: "Matthew Stevens" <matthew.stevens@e...>
Sent: Tuesday, August 07, 2001 12:56 PM
Subject: RE: [iPlanet-JATO] Use Of models in utility classes
Namburi,
I will post a document to the group site this evening which has
the
details
on various tactics of migrating these type of utilities.
Essentially,
you
either need to convert these utilities to Models themselves or
keep the
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of customhelper
method
as a replacement whicch uses JDBC results instead of
CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes.
These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do themanipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion forthese
utilities we have to do manually.
My question is Can we access the the models in the postmigration
sameway or do we need requestContext?
We have lots of utility classes which are DataObjectintensive. Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
[email protected]
[Non-text portions of this message have been removed]
[email protected]
[email protected]Namburi,
When you said you used the Reg Exp tool, did you use it only as
preconfigured by the iMT migrate application wizard?
Because the default configuration of the regular expression tool will only
target the files in your ND project directories. If you wish to target
classes outside of the normal directory scope, you have to either modify the
"Source Directory" property OR create another instance of the regular
expression tool. See the "Tool" menu in the iMT to create additional tool
instances which can each be configured to target different sets of files
using different sets of rules.
Usually, I utilize 3 different sets of rules files on a given migration:
spider2jato.xml
these are the generic conversion rules (but includes the optimized rules for
ViewBean and Model based code, i.e. these rules do not utilize the
RequestManager since it is not needed for code running inside the ViewBean
or Model classes)
I run these rules against all files.
See the file download section of this forum for periodic updates to these
rules.
nonProjectFileRules.xml
these include rules that add the necessary
RequestManager.getRequestContext(). etc prefixes to many of the common
calls.
I run these rules against user module and any other classes that do not are
not ModuleServlet, ContainerView, or Model classes.
appXRules.xml
these rules include application specific changes that I discover while
working on the project. A common thing here is changing import statements
(since the migration tool moves ND project code into different jato
packaging structure, you sometime need to adjust imports in non-project
classes that previously imported ND project specific packages)
So you see, you are not limited to one set of rules at all. Just be careful
to keep track of your backups (the regexp tool provides several options in
its Expert Properties related to back up strategies).
----- Original Message -----
From: <vnamboori@y...>
Sent: Wednesday, August 08, 2001 6:08 AM
Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
forget about the regular expression potential
Thanks Matt, Mike, Todd
This is a great input for our migration. Though we used the existing
Regular Expression Mapping tool, we did not change this to meet our
own needs as mentioned by Mike.
We would certainly incorporate this to ease our migration.
Namburi
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
All--
Great response. By the way, the Regular Expression Tool uses thePerl5 RE
syntax as implemented by Apache OROMatcher. If you're doing lotsof these
sorts of migration changes manually, you should definitely buy theO'Reilly
book "Mastering Regular Expressions" and generate some rules toautomate the
conversion. Although they are definitely confusing at first,regular
expressions are fairly easy to understand with some documentation,and are
superbly effective at tackling this kind of migration task.
Todd
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@S...>
Sent: Tuesday, August 07, 2001 5:20 PM
Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
forget about the regular expression potential
Also, (and Matt's document may mention this)
Please bear in mind that this statement is not totally correct:
Since the migration tool does not do much of conversion for
these
utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
the translation tool, and the regular expression tool, and severalother
smaller tools (like the jar and compilation tools). It is correctto state
that the extraction and translation tools only significantlyconvert the
primary ND project objects (the pages, the data objects, and theproject
classes). The extraction and translation tools do minimumtranslation of the
User Module objects (i.e. they repackage the user module classes inthe new
jato module packages). It is correct that for all other utilityclasses
which are not formally part of the ND project, the extraction and
translation tools do not perform any migration.
However, the regular expression tool can "migrate" any arbitrary
file
(utility classes etc) to the degree that the regular expressionrules
correlate to the code present in the arbitrary file. So first andforemost,
if you have alot of spider code in your non-project classes youshould
consider using the regular expression tool and if warranted adding
additional rules to reduce the amount of manual adjustments thatneed to be
made. I can stress this enough. We can even help you write theregular
expression rules if you simply identify the code pattern you wish to
convert. Just because there is not already a regular expressionrule to
match your need does not mean it can't be written. We have notnearly
exhausted the possibilities.
For example if you say, we need to convert
CSpider.getDataObject("X");
To
RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
rule:
<!--getPage to getViewBean-->
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getViewBean($1ViewBean.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
Following this example a getDataObject to getModel would look
like this:
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getModel($1Model.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
In fact, one migration developer already wrote that rule andsubmitted it
for inclusion in the basic set. I will post another upgrade to thebasic
regular expression rule set, look for a "file uploaded" posting.Also,
please consider contributing any additional generic rules that youhave
written for inclusion in the basic set.
Please not, that in some cases (Utility classes in particular)
the rule
application may be more effective as TWO sequention rules ratherthan one
monolithic rule. Again using the example above, it will convert
CSpider.getDataObject("Foo");
To
getModel(FooModel.class);
Now that is the most effective conversion for that code if that
code is in
a page or data object class file. But if that code is in a Utilityclass you
really want:
>
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
So to go from
getModel(FooModel.class);
To
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
You would apply a second rule AND you would ONLY run this rule
against
your utility classes so that you would not otherwise affect yourViewBean
and Model classes which are completely fine with the simplegetModel call.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getModel\(]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getModel\(]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
A similer rule can be applied to getSession and other CSpider APIcalls.
For instance here is the rule for converting getSession calls toleverage
the RequestManager.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getSession().]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
----- Original Message -----
From: "Matthew Stevens" <matthew.stevens@e...>
Sent: Tuesday, August 07, 2001 12:56 PM
Subject: RE: [iPlanet-JATO] Use Of models in utility classes
Namburi,
I will post a document to the group site this evening which has
the
details
on various tactics of migrating these type of utilities.
Essentially,
you
either need to convert these utilities to Models themselves or
keep the
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of customhelper
method
as a replacement whicch uses JDBC results instead of
CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes.
These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do themanipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion forthese
utilities we have to do manually.
My question is Can we access the the models in the postmigration
sameway or do we need requestContext?
We have lots of utility classes which are DataObjectintensive. Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
[email protected]
[Non-text portions of this message have been removed]
[email protected]
[email protected] -
Regular Expressions in num-exp
Hello All,
I had a problem on my SRST gateway with num-exp insterting a repeating pattern into my 7-digit dialing when in fallback mode.
For a brief example, the 7digit internal dialing is 21621.. or 21622..
The num-exp statement of 'num-exp 2... 2162...' was not allowing me to 7-digit dial directly from one IP phone to another while in fallback mode.
When I dialed 2162154 the 2162 would hit the num-exp and be expended to 2162162.
I have a work around that uses a voice translation-rule, applied to the call-manager-fallback config that will translate a 7-digit dialed string to the 4 digit dialed string which then hits the 4-digit to 7-digit num-exp and it is working fine.
However, I was wondering if there is a way to use regular expressions in num-exp so that perhaps I can skip the intermediate step of using the translation-rule. Based off my existing translation-rules that are working properly, I figured something like this might work for num-exp:
'num-exp /^2\([12]..$\)/ /2162\1/'
But when I try to issue a num-exp with a regular expression I get the following message.
Incorrect format for Number macro pattern
regular expression must be of the form ^((\+)?([0-9#*A-F.]|(\\\*))+(\$)?)$
I have tried a number of different combinations with no success. I always get the same message. The regular expression that I tried first was:
'num-exp ^2... 2162...'
This is when I first saw the "Incorrect format..." message and figured that is must be possible. Is this just a generic warning similar to when you try to use complex regular expressions with the 'translation-rule' command vs. the 'voice translation-rule' command and in reality you cannot use regular expressions in the num-exp command?
Thank you,
LeoHi Chris,
Thank you for taking the time to answer my question. It looks like the answer is no, num-exp does not support regular expressions.
I don't insist on using num-exp for this I was just hoping to kill two birds with one stone and possibly skip the intermediate step of translating the 7-digits dial to 4-digits using a translation-rule just to expand from 4-digit to 7 again. This is only an issue while in SRST if a user tries to dial using 7-digits. We have a 7-digit internal dialing scheme and normally my num-exp is just to expand the 4 digits sent from the telco to our 7-digit internal dialing. The problem is that both our prefix and part of our DID range start with 21 so while in SRST if a user tried to dial a 7-digit DN, say 2162154, after they dialed the 4th digit (2162) that pattern would hit the num-exp and get expanded to 2162162. I was hoping to create a num-exp using a regular expression that would only expand a four digit string that begins with a 2 to seven digits and not any string that begins with a 2. This would 1) expand the four digits sent from the telco and 2) not match a seven digit string that begins with a 2 such as 2162154 which may be dialed by a user.
Again, this is only an issue while in SRST and I have a pretty good work around so I'm fine with not being able to use a regular expression as part of my num-exp config. I just thought it would be a cool application of a regular expression if it was possible.
Thanks again for answering my question.
Leo -
Regular Expressions, include and exclude xml-files
Hi!
I have a javaprogram that should read xml-files from a directory. The program could contain several types of files but it should only read files with a certain pattern.
The file names will look like this:
"resultset_27_23.xml"
where the numbers will change, but the rest of the file name is the same (resultset_XX_XX.xml).
But in the same directory it will also be files with the following pattern:
"resultset_27_23_attachment1.xml"
Here, the numbers could change in the in the same way as the files above, and the number after the text (attachment) could also differ from file to file.Those files should not be read by the program.
I have tried to write a regular expression pattern that only reads the first file types, and exlcudes the other ones, but it won�t work.
Does anyone have a solution to my problem? It is possible to use either just one pattern, or two patterns; one for the files that should be included, and one for the files that should be excluded.So you only want files that match resultset_XX_XX.xml? Will the numbers always be two digits each? Assuming so:
"^resultset_\\d\\d_\\d\\d.xml$"Depending which methods you use, the ^ and $ may or may not be necessary.
If that's not what you meant, please clarify. -
Regular Expressions X Performance
I'd like know what do they you about the use of Regular Expressions? It's more fast?
Regular expressions can be interpreted by a DFA and the computational cost of its execution is the same cost of traversing the string char by char.
To find substrings there are algorithms that can skip a lot of chars during the traversing of the string and they result much faster than the analogus ones based on regular expression. But theese algorithms can't interpret regular expressions they work only on exact strings.
So when you're looking for an exact string the use of exact string matching is much faster than the use of regular expression matching.
http://en.wikipedia.org/wiki/String_searching_algorithm
http://en.wikipedia.org/wiki/Pattern_matching
http://en.wikipedia.org/wiki/Regular_expression
Bye Alessandro -
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 -
Regular expressions (gnu.regexp) (porting)
i am porting a c++ application to java
the cpp application was using the c version of gnu.regexp as a dll
in java i am using the gnu.regexp package
i tried to compile the regular expressions with the same flags as in the c++ program they are
RE_CHAR_CLASSES
RE_CONTEXT_INDEP_ANCHORS
RE_CONTEXT_INDEP_OPS
RE_DOT_NEWLINE
RE_DOT_NOT_NULL
RE_INTERVALS
RE_NO_BK_BRACES
RE_NO_BK_PARENS
RE_NO_BK_VBAR
RE_NO_EMPTY_RANGES
RE_UNMATCHED_RIGHT_PAREN_ORD
i have two regular expression as shown below
1. (\\<(ab )?abc[:]? [(]?abcdegth abcdef ([:]|([(][A-Z0-9 /-]{10,50} [)])) aabbccd )
2. (\\<SIL)|(\\(REF[:] AIB[-]SIL)
if i compile them using the same flags i get a EXPETED END OF SUB EXPRESSION ERROR
but it works fine in cpp
the regular expression 2 works only if RE_NO_BK_PARENS is set and the reqular expression one compiles successfully only if RE_NO_BK_PARENS is not set can any body give me a alternate solution ( i.e a possible solution where i can compile both )
p.s : i tried to find gnu.regexp fourums but i could not find please help me
thanks a lot in advancewhy not using the java.util.regex package of 1.4?but for my application using gnu.regexp is much suited
-
Regular expression to only allow numeric chars or spaces in tel num field
Hi folks
Am Apex Newbie using 4.0.1 / Vista / Oracle XE and am trying to create an item level validation on a tel number field.
I want any combination of numbers and spaces to be valid with only the obvious proviso that the field cant be completely spaces.
Can anyone help suggest how to do this as am really struggling with something so simple as I have no prev exp of reg expressions.
Many thanks as always
PeterHi,
it's quite strange, I just tried your input (without apostrophes) and it passed. Did you copied my reg exp (from ^ to $ included) and pasted it into Validation Expression 2 field of validation with type Regular Expression? It really should work.
Jirka
Maybe you are looking for
-
Dear All, I m facing a Problem in pricing Procedure.It is as below RATE QTY. AMOUNT BASIC RATE 63.5 15998.8 1015923.80 LESS SPL DISCOUNT 1.75 15998.8 27997.9 LESS FREIGHT 0.56
-
Value-based hierarchy on ROLAP dimension. Is this possible and how?
Value-based hierarchy on ROLAP dimension. Is this possible and how? If yes, what tool I have to use. Any simple examples?
-
Error: Error in OPEN_FORM for document '123456789' in ME9A(print preview)
Hello Experts, I am encountering an error when I try to print preview my RFQ form via ME9A. What I did was to just copy the existing custom form to my own custom form then assign my form to our output type via NACE transaction. So when I click the di
-
I have paid for this movie but am unable to watch it because no matter what I do it won't load. I've checked my wireless connection and it seems to be working fine, and netflix works on the Apple Tv but I can't seem to get this movie to play (and not
-
I never had this problem between the 1st generation tv and the 2nd generation tv. Please, Advise Bill burrows