Re: need help on regular expression



Harry wrote...

I want to match a name like these,
A^Male or A^Female or
U^Male or U^Female or
D^Male or D^Female or

There may be zero, one, or more letters between the first letter [ADU]
and the ^ character.

I am using the regexp on Oracle 11, with the following expression (not
working) ...
where ... and REGEXP_LIKE(upper(column_name, '^[ADU](.)*\^FEMALE|MALE
$')

which picked up name like 'Wu...^Female'.

Yeah, I should go to oracle group ... but I hope this regular
expression thing
is not Oracle specific.

Examples without Oracle ...
Why would the following name not filtered out?


$ echo Wuxyz^Female | tr [[:lower:]] [[:upper:]] |
egrep '^[ADU](.)*\^FEMALE|MALE$'
WUXYZ^FEMALE

$ echo Wuxyz^Female | tr [[:lower:]] [[:upper:]] |
egrep '^[ADU](.)*\^FMALE|MALE$' <-- no E for FEMALE
WUXYZ^FEMALE


.



Relevant Pages

  • Re: Capitalize first letter of FIRST word
    ... is stored in ALL CAPS. ... the first letter of each sentence capitalized. ... Initcap doesn't quite do the trick since it converts the first ... Oracle Ace Director & Instructor ...
    (comp.databases.oracle.server)
  • Re: Searching Text in words
    ... I need to be able to search some text, basically company names, and ... I'm only looking to match on the first letter of each 'word'. ... I was looking for B then International Business Machines would give me ... such and try it that way, but I was wondering if Oracle had a better ...
    (comp.databases.oracle.server)
  • need help on regular expression
    ... There may be zero, one, or more letters between the first letter [ADU] ... I should go to oracle group ... ... but I hope this regular ...
    (comp.unix.shell)
  • Re: need help on regular expression
    ... On 5/19/2012 10:14 PM, Harry wrote: ... There may be zero, one, or more letters between the first letter ... I should go to oracle group ... ...
    (comp.unix.shell)
  • Re: Use Inserted Script Values
    ... so please excuse if this question is strange in some kind of way... ... I want to CONCATENATE two Strings, which I have inserted to a table. ... I have to create a userid which is the first letter of the first name ... I use an Oracle Online Workspace. ...
    (comp.databases.oracle.server)