Welcome, Guest
Username: Password: Remember me
General discussions, feature requests for CodeTyphon Project and discussions that don't fit in any of the other specific CodeTyphon forum categories.
  • Page:
  • 1

TOPIC:

RegEx search in CT 11 years 4 months ago #4266

  • opc0de
  • opc0de's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 15
  • Thank you received: 1
Hello

I was wondering if there is any function in CT witch will return the position of the regex if found in a string.

Thanks

sternas keep up the amazing work!

Please Log in or Create an account to join the conversation.

RegEx search in CT 11 years 4 months ago #4268

  • ExDatis
  • ExDatis's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 110
  • Thank you received: 9
Hi, you can use:
wiki.freepascal.org/Regexpr
or simple function pos(someString, ChrToFind)
Regards

Please Log in or Create an account to join the conversation.

RegEx search in CT 11 years 4 months ago #4269

  • ExDatis
  • ExDatis's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 110
  • Thank you received: 9

Please Log in or Create an account to join the conversation.

RegEx search in CT 11 years 4 months ago #4270

  • ExDatis
  • ExDatis's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 110
  • Thank you received: 9
Also, there is many interesting things...
lazarus-ccr.sourceforge.net/docs/rtl/strutils/index-5.html

Please Log in or Create an account to join the conversation.

RegEx search in CT 11 years 4 months ago #4271

  • opc0de
  • opc0de's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 15
  • Thank you received: 1
I know there is pos but is a great difference between finding a regex and a position of a string.

I know about the regex class but I didn't find a function that will return the position of regex in string.

Thank you
The following user(s) said Thank You: ExDatis

Please Log in or Create an account to join the conversation.

RegEx search in CT 11 years 4 months ago #4272

  • ExDatis
  • ExDatis's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 110
  • Thank you received: 9
Try to find something in StrUtils

Please Log in or Create an account to join the conversation.

RegEx search in CT 11 years 4 months ago #4273

  • Aleksandar
  • Aleksandar's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 150
  • Thank you received: 31

opc0de wrote: I was wondering if there is any function in CT witch will return the position of the regex if found in a string.


You can try one of those listed here

wiki.freepascal.org/Regexpr

Please let me know how useful they really are. If they do not support things like positive/negative lookahead, then they are useful only for some really basic search. I wish there is some PCRE wrapper for FPC like TPerlRegEx for Delphi.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1