sql - what will be the regular expression for allowing alphanumeric characters, space, hypen in between, dot at the end or in between -


i new regular expression. using regular expression in sql query. , want display records contain other than: alphanumeric characters, white spaces, hyphen(-) in between string, dot(.)in end , in between string. have been able alphanumeric characters , spaces. hyphen , dot creating problem.

for eg: "first.name", "firstname." should not come ".firstname" should come in result.

and "first-name" should not come "-firstname" , "firstname-" should come in result.

as of have done this.

select * my_table  column1 '.%' or column1  '-%' or  regexp_like(column1 ,'[^[:alnum:]^[:blank:]]'); 

the above query working in way allows dot , hyphen @ place in string. , not places want discussed above.

can me in this.

i've create table yours , statement

select * tmp x '.%' or x '-%' or x '%-'; 

works fine - . , - :)


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -