Skip to content

Commit

Permalink
fixed regex
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioloporto authored and iamleeg committed Jul 8, 2021
1 parent 782ac04 commit f787373
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions verification/curator-service/ui/src/components/ViewCase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ interface Props {
onModalClose: () => void;
}

interface State {
case?: Case;
errorMessage?: string;
loading: boolean;
}

export default function ViewCase(props: Props): JSX.Element {
const [c, setCase] = useState<Case>();
const [loading, setLoading] = useState<boolean>(false);
Expand Down Expand Up @@ -93,10 +87,6 @@ export default function ViewCase(props: Props): JSX.Element {
</AppModal>
);
}

interface LocationState {
search: string;
}
interface CaseDetailsProps {
c: Case;
enableEdit?: boolean;
Expand Down Expand Up @@ -833,7 +823,17 @@ function RowHeader(props: { title: string }): JSX.Element {

function RowContent(props: { content: string; isLink?: boolean }): JSX.Element {
const searchQuery = useSelector(selectSearchQuery);
const searchQueryArray = searchQuery.match(/"([^"]+)"|\w{3,}/g) ?? [];
const searchQueryArray: any[] = [];

function words(s: string) {
const regex = /"([^"]+)"|(\w{3,})/g;
let match;
while ((match = regex.exec(s))) {
searchQueryArray.push(match[match[1] ? 1 : 2]);
}
return searchQueryArray;
}
words(searchQuery);

return (
<Grid item xs={8}>
Expand Down

0 comments on commit f787373

Please sign in to comment.