Recent

Author Topic: How to find Regular Expression  (Read 2241 times)

bpranoto

  • Full Member
  • ***
  • Posts: 134
How to find Regular Expression
« on: March 14, 2021, 07:30:57 am »
In the IDE, I want to find a regular expression.

1. Open the find dialog
2. Check Regular Expression
3. Uncheck Case Sensitive
4. Fill the Text to find: AsFloat *:=
5. Click Find Button

Unfortunately, an Error dialog popped up: TRegExpr exec: empty input string

Did I miss something or i just found a bug?

Environment:
Lazarus 2.0.12
Ubuntu 18.04

Thanks.

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: How to find Regular Expression
« Reply #1 on: March 14, 2021, 09:12:06 am »
hello,
can you show us, a line with what are you searching for ?
Friendly J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

bpranoto

  • Full Member
  • ***
  • Posts: 134
Re: How to find Regular Expression
« Reply #2 on: March 14, 2021, 09:17:47 am »
Hi JP,

Something like:

Code: Pascal  [Select][+][-]
  1. Self.FQupdate.ParamByName('xxx').AsFloat := xxx;
  2.  

The problem is not what I want to find, but the IDE find facility. Even when I put a simple text to find like 'a' it will throw the same error message.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6688
Re: How to find Regular Expression
« Reply #3 on: March 14, 2021, 09:42:21 am »
Looks like an erratic bug in recent versions up to and including trunk. Works properly in 2.0.6, not sure about intervening versions.

MarkMLl

MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: How to find Regular Expression
« Reply #4 on: March 14, 2021, 09:49:03 am »
with  lazarus version 2.0.10    same bug. With the option Multiline pattern no error but the result isn't good

[EDIT]  O.S : windows 10
« Last Edit: March 14, 2021, 09:54:36 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: How to find Regular Expression
« Reply #5 on: March 14, 2021, 09:52:19 am »
Works in Lazarus trunk + FPC trunk on macOS.

[edit]

Works in Lazarus 2.0.6 and FPC 3.0.4.
Fails in Lazarus 2.0.10 and FPC 3.2.0.
« Last Edit: March 14, 2021, 09:59:27 am by trev »

ASerge

  • Hero Member
  • *****
  • Posts: 2242
Re: How to find Regular Expression
« Reply #6 on: March 14, 2021, 10:12:31 am »
Works in Lazarus trunk + FPC trunk on macOS.
Works in Lazarus 2.0.6 and FPC 3.0.4.
Fails in Lazarus 2.0.10 and FPC 3.2.0.
In Windows the same: works in trunk 2.1.0, fails in 2.0.10.

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Re: How to find Regular Expression
« Reply #7 on: March 14, 2021, 10:25:18 am »
It is a known bug if FPC's regexpr unit. I already posted the fix, try the more recent FPC 3.2 versions.

bpranoto

  • Full Member
  • ***
  • Posts: 134
Re: How to find Regular Expression
« Reply #8 on: March 14, 2021, 12:29:36 pm »
All, thank you.

Glad it is already fix for the next fpc version. Just curious, does it mean TRegExp suffer the same bug?

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Re: How to find Regular Expression
« Reply #9 on: March 14, 2021, 12:51:41 pm »
TRegExp is another component, so it does not.

 

TinyPortal © 2005-2018