Re: how to match the first pattern

2018-08-03 Thread Sand Glass
On Tuesday, July 31, 2018 at 4:57:41 PM UTC+8, Michael Wagner wrote: > On Jul 30, 2018 um 18:46:42, Sand Glass wrote: > > On Monday, July 30, 2018 at 8:13:26 PM UTC+8, Tony Mechelynck wrote: > > > > > > Ah yes, there are several regular-expression "dialects", often quite > > > similar but not

Re: how to match the first pattern

2018-07-31 Thread Chr. von Stuckrad
On Tue, 31 Jul 2018, Michael Wagner wrote: > On Jul 30, 2018 um 18:46:42, Sand Glass wrote: > If you are on Linux, you can test 'txt2regex'. Interesting! And a good way to compose for more than one of the dialects. Bit ALAS, it does not know (as far as I saw) about 'shortest' aka non-greedy

Re: how to match the first pattern

2018-07-31 Thread Michael Wagner
On Jul 30, 2018 um 18:46:42, Sand Glass wrote: > On Monday, July 30, 2018 at 8:13:26 PM UTC+8, Tony Mechelynck wrote: > > > > Ah yes, there are several regular-expression "dialects", often quite > > similar but not always strictly identical, and depending on whether > > you are using grep (which

Re: how to match the first pattern

2018-07-30 Thread Sand Glass
On Tuesday, July 31, 2018 at 9:46:43 AM UTC+8, Sand Glass wrote: > On Monday, July 30, 2018 at 8:13:26 PM UTC+8, Tony Mechelynck wrote: > > On Mon, Jul 30, 2018 at 1:55 PM, Chr. von Stuckrad > > wrote: > > > On Mon, 30 Jul 2018, Sand Glass wrote: > > > > > >> On Saturday, July 28, 2018 at 3:18:23

Re: how to match the first pattern

2018-07-30 Thread Sand Glass
On Monday, July 30, 2018 at 8:13:26 PM UTC+8, Tony Mechelynck wrote: > On Mon, Jul 30, 2018 at 1:55 PM, Chr. von Stuckrad > wrote: > > On Mon, 30 Jul 2018, Sand Glass wrote: > > > >> On Saturday, July 28, 2018 at 3:18:23 PM UTC+8, Sand Glass wrote: > >> > how can I stop the pattern at the first

Re: how to match the first pattern

2018-07-30 Thread Tony Mechelynck
On Mon, Jul 30, 2018 at 1:55 PM, Chr. von Stuckrad wrote: > On Mon, 30 Jul 2018, Sand Glass wrote: > >> On Saturday, July 28, 2018 at 3:18:23 PM UTC+8, Sand Glass wrote: >> > how can I stop the pattern at the first "]"? >> It's good in vim. Then I try to use the regular in perl script, but

Re: how to match the first pattern

2018-07-30 Thread Chr. von Stuckrad
On Mon, 30 Jul 2018, Sand Glass wrote: > On Saturday, July 28, 2018 at 3:18:23 PM UTC+8, Sand Glass wrote: > > how can I stop the pattern at the first "]"? > It's good in vim. Then I try to use the regular in perl script, but failed. Same 'thing', i.e. the shortest match, so (in linux 'man

Re: how to match the first pattern

2018-07-30 Thread Sand Glass
On Saturday, July 28, 2018 at 3:18:23 PM UTC+8, Sand Glass wrote: > This is my code block: > ### > output [NUM_STAGE-1:0] enable; > input [7:0] big_grad_thr;//8'h10 [2:0] > ### > I want to find pattern "[NUM_STAGE-1:0]" "[7:0]", > I tried '/\[.*\]', but the result is "[7:0]

Re: how to match the first pattern

2018-07-28 Thread Tony Mechelynck
On Sat, Jul 28, 2018 at 9:18 AM, Sand Glass wrote: > This is my code block: > ### > output [NUM_STAGE-1:0] enable; > input [7:0] big_grad_thr;//8'h10 [2:0] > ### > I want to find pattern "[NUM_STAGE-1:0]" "[7:0]", > I tried '/\[.*\]', but the result is "[7:0]

how to match the first pattern

2018-07-28 Thread Sand Glass
This is my code block: ### output [NUM_STAGE-1:0] enable; input [7:0] big_grad_thr;//8'h10 [2:0] ### I want to find pattern "[NUM_STAGE-1:0]" "[7:0]", I tried '/\[.*\]', but the result is "[7:0] big_grad_thr;//8'h10 [2:0]", how can I stop the pattern at the first "]"? -- --