V
Vince
Hey,
I need to find the following by matching Wild Cards.
1.1 mol/L
1 mol/L
1mol/L
1.1 mol /L
1 mol /L
1mol /L
1.1 mol / L
1 mol / L
1mol / L
1.1 mol/ L
1 mol/ L
1mol/ L
A sentence could contain any one this. For instance "James drank a solution
of Nitrogen Peroxide with a concentration of 5.15 mol/L".
This is what I could come up with:
([0-9.]@)( @)(mol/L)
Takes care of any numerals / decimals but does not account for:
a) The space between the number and mol/L (It looks for one space or more
but there is a possibility that a space might not exist like 1.1mol/L)
b) It strictly looks for mol/L and can't account for mol / L, mol/ L or mol
/L. In order to use this, I would have to repeat each instance with
appropriate spaces!
Questions:
1) How do I write a single Wildcard match for all the possibilities listed
above?
2) How can I say "Optional" in Regex. Eg. Di[peg] could be anyone of "Dig"
"Dip" or "Die". But I need to say that "Di" may or may not be followed by
"p" "e" or "g". In Perl, I would say "(Di)([epg])*" How do I say that in
VBA?
Thanks a lot for your time / any reponse.
Vince
I need to find the following by matching Wild Cards.
1.1 mol/L
1 mol/L
1mol/L
1.1 mol /L
1 mol /L
1mol /L
1.1 mol / L
1 mol / L
1mol / L
1.1 mol/ L
1 mol/ L
1mol/ L
A sentence could contain any one this. For instance "James drank a solution
of Nitrogen Peroxide with a concentration of 5.15 mol/L".
This is what I could come up with:
([0-9.]@)( @)(mol/L)
Takes care of any numerals / decimals but does not account for:
a) The space between the number and mol/L (It looks for one space or more
but there is a possibility that a space might not exist like 1.1mol/L)
b) It strictly looks for mol/L and can't account for mol / L, mol/ L or mol
/L. In order to use this, I would have to repeat each instance with
appropriate spaces!
Questions:
1) How do I write a single Wildcard match for all the possibilities listed
above?
2) How can I say "Optional" in Regex. Eg. Di[peg] could be anyone of "Dig"
"Dip" or "Die". But I need to say that "Di" may or may not be followed by
"p" "e" or "g". In Perl, I would say "(Di)([epg])*" How do I say that in
VBA?
Thanks a lot for your time / any reponse.
Vince