Jump to content

Recommended Posts

Posted (edited)

I have this

p[\s*|\.|\,]*o[\s*|\.\,]*b\s*o\s*x[\s*\|\.|\,]*.*

but I want to strip the POBox. Examples:

"POBox111" --> "111"

"222 PO Box 333" --> "333"

"44P OB o x 55" --> "55"

How do I fix my pattern? backreference?

Any help?

Thanks!

Edit:

or I could use (x)(\s*)(.*)

but I still need to ignore the 'x'...

Edit:

of course I could just strip the first letter (x) from the result afterwards, but would like to know how to do this in regex properly.

Thanks!

Edited by sensalim
Posted (edited)

What is (?i)

?

It doesn't work on my t-sql (This is actually for my project in microsoft sql server management studio)

This might be it:

(?<=x)\s*.*

Edited by sensalim

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...