regex - Workaround for the lack of lookbehind? -


To answer, I knocked the regular expression down together to match the numbers within a string.

  \ b [+ -]? [0-9] + (\ [0- 9] +)? After giving me the answer, I saw that in those cases I was getting unwanted matches where the number of points was matched with the period between them over time. Was there. For example,  "2.3.4"  will match  "2.3"  and  "4" . 

A negative form and give me a regex like this, can help me here:

  \ b (? & Lt; !!) [+ -]? [0 -9] + (\ [0- 9] +)? \ B (?!!)  

... Apart from that some unknown reason does not support VBScript Regex (and by extension VBA) somehow.

Do I have a saying that I get the permission to confirm that the word boundary in the beginning of the match is in the match without any period?

Maybe you do not have to look back if you want to remove a specific capture group instead of the whole match You can use it if:

(?: [^.] | ^) \ B ([+ -]? ([0 -9] + (\ [0 -9] +))) \ b (?!!)

will mail:

  2.5 54.5 +3.45 -0.5  < / Pre> 

will not match:

  1.2.3. .3.5  
  • The Captive Group will produce 1 full number and will sign
  • Capture Group will produce 2 full numbers
  • Capture Group 3 will output to output (like capturing group 1 in your original expression)

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -