Infamous Regexp

opazzo

Board Regular
Joined
Dec 21, 2005
Messages
69
Office Version
  1. 365
Platform
  1. Windows
Hi All,

Could you help me with the following Regexp problem :

I would like a regex findig this :

JV or /JV or JV/ or /JV/ or JV( or (JV or )JV or JV)

But not GJV / JVA/ JVG

I tried that :
\W?[^0-9A-Z_]?JV[^0-9A-Z_]\W?

But I Must be wrong as it keeps find GJV

Any ideas ?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
You may be able to adapt this to what you are doing.

I used the MOREFUNC add-in for this.

Formula in B1:
=NOT(REGEX.FIND(SUBSTITUTE(A1,"JV",""),"\w")+NOT(ISNUMBER(FIND("JV",A1))))
Book1
ABCD
1JVTRUE
2GJVFALSE
3JVA/FALSE
4(FALSE
5/JV/TRUE
Sheet1
 
Upvote 0
Hi All,

Could you help me with the following Regexp problem :

I would like a regex findig this :

JV or /JV or JV/ or /JV/ or JV( or (JV or )JV or JV)

But not GJV / JVA/ JVG

I tried that :
\W?[^0-9A-Z_]?JV[^0-9A-Z_]\W?

But I Must be wrong as it keeps find GJV

Any ideas ?

Are you just trying to match part of a string - or the whole string?

And are these valid matches too?
(JV)
)JV(

Cheers

Dave
 
Upvote 0

Forum statistics

Threads
1,224,862
Messages
6,181,464
Members
453,044
Latest member
rgbenson1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top