Extracting the return value in Squeak (SmallTalk)
I want to extract the return value from a given text that represent a method. for example: g: x and: y Transcript show: x; show: y. ^x+y. so to solve I used the regular expression: \^\s*(\w+.*). when I run this on some regex websites it seems to work and do what I want, for example : https://regex101.com/ but when I run the following program it seems that squeak return nil to it (can't find a match). I suspect that is because I am using the character ^. but I escaped that character so I have no idea why that is failing to work. the code I used to test it: |aString regexObj | aString := 'g: x and: y Transcript show: x; show: y. ^x+y.'. regexObj := '\^\s*(\w+.*).' asRegex. regexObj matches: aString. returnedType:= (regexObj subexpression:2). Transcript show: returnedType. anyone knows why, and how to solve it? ,Thanks.
VB Net RegEx Match Multiple
Invalid Escape Character in Regex for html 5 Input Validation
Regex to match start and end line [duplicate]
How to handle “cannot refer to an open group at position” in Python?
How to format the output of a grep with a regex pattern to match between a string and character
Regular expression to match a line containing only the list of words
How do I create a regex for 2 different patterns that outputs in 1 group, in Google sheets?
Replacing a string in between known strings over mutiple lines in Powershell
Data Preperation Identify String using Regex and move to new column
Regular expressions - optional brackets
ICU Regex matching for non-digit and no whitespace
Seemingly incorrect regex evaluation in regexp_replace
How to detect a string which does not include " using flex?
Extract certain values from string in .txt files with PowerShell
Apache 301 Redirect Add language prefix if not present
Regex, match characters and doesn't contain more than one _ followed by another _