To use or not to use regular expressions?

前端 未结 5 1842
再見小時候
再見小時候 2020-11-27 18:00

I just asked this question about using a regular expression to allow numbers between -90.0 and +90.0. I got some answers on how to implement the regular expression, but mos

5条回答
  •  温柔的废话
    2020-11-27 18:54

    Basic use-case for RegEx :-

    1. You need "Key Value Pairs" - Both Key and Values are embedded within other noisy text - cant be accessed or isolated otherwise.

    2. You need to automate extraction of these values by looping over multiple documents.

    3. Number and combination of Key Value pairs maybe discovered as you progress parsing through text.

提交回复
热议问题